You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ji...@apache.org on 2018/08/09 02:45:14 UTC
[couchdb] 03/05: Fix default security object handling
This is an automated email from the ASF dual-hosted git repository.
jiangphcn pushed a commit to branch COUCHDB-3326-clustered-purge-pr1-misc-cleanup
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit c96df45bb7f1d46fef4dc8108f2e90464de8067e
Author: Paul J. Davis <pa...@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