couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [couchdb] 01/01: call commit_data where needed
Date Thu, 12 Apr 2018 16:33:45 GMT
This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a commit to branch commit_data_pse
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 33783c3deacfa9d869171145a32d77453e862c99
Author: Robert Newson <rnewson@apache.org>
AuthorDate: Thu Apr 12 17:26:28 2018 +0100

    call commit_data where needed
    
    Regression since introduction of PSE
---
 src/couch/src/couch_db_updater.erl | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/couch/src/couch_db_updater.erl b/src/couch/src/couch_db_updater.erl
index 79567e9..a2de3bc 100644
--- a/src/couch/src/couch_db_updater.erl
+++ b/src/couch/src/couch_db_updater.erl
@@ -82,16 +82,17 @@ handle_call(cancel_compact, _From, #db{compactor_pid = Pid} = Db) ->
 
 handle_call({set_security, NewSec}, _From, #db{} = Db) ->
     {ok, NewDb} = couch_db_engine:set_security(Db, NewSec),
-    NewSecDb = NewDb#db{
+    NewSecDb = commit_data(NewDb#db{
         security = NewSec
-    },
+    }),
     ok = gen_server:call(couch_server, {db_updated, NewSecDb}, infinity),
     {reply, ok, NewSecDb, idle_limit()};
 
 handle_call({set_revs_limit, Limit}, _From, Db) ->
     {ok, Db2} = couch_db_engine:set_revs_limit(Db, Limit),
-    ok = gen_server:call(couch_server, {db_updated, Db2}, infinity),
-    {reply, ok, Db2, idle_limit()};
+    Db3 = commit_data(Db2),
+    ok = gen_server:call(couch_server, {db_updated, Db3}, infinity),
+    {reply, ok, Db3, idle_limit()};
 
 handle_call({purge_docs, _IdRevs}, _From,
         #db{compactor_pid=Pid}=Db) when Pid /= nil ->
@@ -160,12 +161,12 @@ handle_call({purge_docs, IdRevs}, _From, Db) ->
     Pairs = pair_purge_info(PreviousFDIs, FDIs),
 
     {ok, Db2} = couch_db_engine:write_doc_infos(Db, Pairs, [], PurgedIdRevs),
-
-    ok = gen_server:call(couch_server, {db_updated, Db2}, infinity),
+    Db3 = commit_data(Db2),
+    ok = gen_server:call(couch_server, {db_updated, Db3}, infinity),
     couch_event:notify(Db#db.name, updated),
 
-    PurgeSeq = couch_db_engine:get_purge_seq(Db2),
-    {reply, {ok, PurgeSeq, PurgedIdRevs}, Db2, idle_limit()};
+    PurgeSeq = couch_db_engine:get_purge_seq(Db3),
+    {reply, {ok, PurgeSeq, PurgedIdRevs}, Db3, idle_limit()};
 
 handle_call(Msg, From, Db) ->
     case couch_db_engine:handle_db_updater_call(Msg, From, Db) of

-- 
To stop receiving notification emails like this one, please contact
rnewson@apache.org.

Mime
View raw message