summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2018-04-26 11:38:24 -0500
committerjiangph <jiangph@cn.ibm.com>2018-08-21 09:11:30 +0800
commit151b9b05f42794062c021a40628e0ada168e5ccc (patch)
tree0234a3769b1dae1f9a169ce5aa3725df570a0102
parentda2e22a2799f7426fa49fd1d5c3646a465c54b44 (diff)
downloadcouchdb-151b9b05f42794062c021a40628e0ada168e5ccc.tar.gz
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.
-rw-r--r--src/couch/src/couch_bt_engine.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/couch/src/couch_bt_engine.erl b/src/couch/src/couch_bt_engine.erl
index ee0d6d864..c5df11bc9 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