From e9fc291e81a93a92d3519df4d460e495cddb4e11 Mon Sep 17 00:00:00 2001 From: Robert Newson Date: Sun, 31 Mar 2019 14:49:47 +0100 Subject: Change _security object for new dbs to admin-only by default --- rel/overlay/etc/default.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini index 2a920092f..bec0f3b51 100644 --- a/rel/overlay/etc/default.ini +++ b/rel/overlay/etc/default.ini @@ -28,7 +28,7 @@ attachment_stream_buffer_size = 4096 ; admin_only - only admins can read/write ; admin_local - sharded dbs on :5984 are read/write for everyone, ; local dbs on :5986 are read/write for admins only -default_security = admin_local +default_security = admin_only ; btree_chunk_size = 1279 ; maintenance_mode = false ; stem_interactive_updates = true -- cgit v1.2.1 From 5010b2f002c5d66b4cc82aa54625486d4cc15a26 Mon Sep 17 00:00:00 2001 From: Robert Newson Date: Fri, 12 Apr 2019 16:20:21 +0100 Subject: Don't reset_index if read_header fails This decision is an old one, I think, and took the view that an error from read_header meant something fatally wrong with this index file. These days, it's far more likely to be something else, a process crash at the wrong moment, and therefore wiping the index out is an overreaction. --- rel/overlay/etc/default.ini | 2 +- src/couch_mrview/src/couch_mrview_index.erl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini index bec0f3b51..2a920092f 100644 --- a/rel/overlay/etc/default.ini +++ b/rel/overlay/etc/default.ini @@ -28,7 +28,7 @@ attachment_stream_buffer_size = 4096 ; admin_only - only admins can read/write ; admin_local - sharded dbs on :5984 are read/write for everyone, ; local dbs on :5986 are read/write for admins only -default_security = admin_only +default_security = admin_local ; btree_chunk_size = 1279 ; maintenance_mode = false ; stem_interactive_updates = true diff --git a/src/couch_mrview/src/couch_mrview_index.erl b/src/couch_mrview/src/couch_mrview_index.erl index ac433335c..03701693f 100644 --- a/src/couch_mrview/src/couch_mrview_index.erl +++ b/src/couch_mrview/src/couch_mrview_index.erl @@ -122,7 +122,7 @@ open(Db, State0) -> case couch_mrview_util:open_file(IndexFName) of {ok, Fd} -> - case (catch couch_file:read_header(Fd)) of + case couch_file:read_header(Fd) of % upgrade code for <= 1.2.x {ok, {OldSig, Header}} -> % Matching view signatures. @@ -135,7 +135,7 @@ open(Db, State0) -> NewSt = couch_mrview_util:init_state(Db, Fd, State, Header), ensure_local_purge_doc(Db, NewSt), {ok, NewSt}; - _ -> + no_valid_header -> NewSt = couch_mrview_util:reset_index(Db, Fd, State), ensure_local_purge_doc(Db, NewSt), {ok, NewSt} -- cgit v1.2.1