diff options
author | Paul J. Davis <paul.joseph.davis@gmail.com> | 2018-04-26 11:38:24 -0500 |
---|---|---|
committer | Paul J. Davis <paul.joseph.davis@gmail.com> | 2018-05-23 13:29:18 -0500 |
commit | 39d7803c5e3f7645f0d193edd7bdbc0d892317c1 (patch) | |
tree | f5def7d1110c86e8d98f59b29f154d3594496ed3 | |
parent | 127bfdad0cf856c3bb8b772ecb35eb0a7e50df00 (diff) | |
download | couchdb-39d7803c5e3f7645f0d193edd7bdbc0d892317c1.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.erl | 2 |
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 43a77b071..2583f10a8 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 |