diff options
author | Robert Newson <rnewson@apache.org> | 2019-04-12 21:43:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-12 21:43:19 +0100 |
commit | 91b299d04a4ded2e11fb65972984b24d3491d1aa (patch) | |
tree | 18b8e1aa840474018e9d7da2d103113027f0ef49 | |
parent | bb30e984c653640b5ef9b80d3e5a2801bad14efe (diff) | |
parent | 5010b2f002c5d66b4cc82aa54625486d4cc15a26 (diff) | |
download | couchdb-91b299d04a4ded2e11fb65972984b24d3491d1aa.tar.gz |
Merge pull request #2003 from apache/dont-reset-index
Don't reset_index if read_header fails
-rw-r--r-- | src/couch_mrview/src/couch_mrview_index.erl | 4 |
1 files changed, 2 insertions, 2 deletions
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} |