This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch 
COUCHDB-3326-clustered-purge-pr2-simplify-mem3-rep
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 9b4ec0a0eacb698885af74f88b4227bce67ded8a
Author: Paul J. Davis <paul.joseph.da...@gmail.com>
AuthorDate: Thu Apr 26 11:38:24 2018 -0500

    Fix default security object handling
    
    There's a race where if a database is opened with a default_security set
    and it crashes before first compact, and is then reopened after the
    default_security option has changed that it will pick the second
    security option. This change fixes the relatively obscure bug
    that was only found during testing.
---
 src/couch/src/couch_bt_engine.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/couch/src/couch_bt_engine.erl 
b/src/couch/src/couch_bt_engine.erl
index ee0d6d8..c5df11b 100644
--- a/src/couch/src/couch_bt_engine.erl
+++ b/src/couch/src/couch_bt_engine.erl
@@ -727,7 +727,7 @@ init_state(FilePath, Fd, Header0, Options) ->
     % to be written to disk.
     case Header /= Header0 of
         true ->
-            {ok, NewSt} = commit_data(St),
+            {ok, NewSt} = commit_data(St#st{needs_commit = true}),
             NewSt;
         false ->
             St

Reply via email to