Skip to content

Commit

Permalink
Always commit if we upgrade 2.x view files
Browse files Browse the repository at this point in the history
When we upgrade empty view files from 2.x, we end up skipping the commit.
Subsequently, we will see a "wrong signature" error when the view is opened
later. The error is benign as we'd end up resetting an empty view, but it may
surprise an operator. To avoid this, ensure to always commit after upgrading
old views.

Issue: #4994
  • Loading branch information
nickva committed Apr 10, 2024
1 parent 7ab3f30 commit f3d7939
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/couch_mrview/src/couch_mrview_index.erl
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ open(Db, State0) ->
{ok, {OldSig, Header}} ->
% Matching view signatures.
NewSt = init_and_upgrade_state(Db, Fd, State, Header),
ok = commit(NewSt),
ensure_local_purge_doc(Db, NewSt),
{ok, NewSt};
% end of upgrade code for <= 2.x
Expand Down

0 comments on commit f3d7939

Please sign in to comment.