You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2024/04/10 19:34:47 UTC
(couchdb) 01/01: Always commit if we upgrade 2.x view files
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch always-commit-if-we-upgrade-the-old-signature
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 025eff0c611ab7196da0197405649cb4ba062839
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Wed Apr 10 15:24:55 2024 -0400
Always commit if we upgrade 2.x view files
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: https://github.com/apache/couchdb/issues/4994
---
src/couch_mrview/src/couch_mrview_index.erl | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/couch_mrview/src/couch_mrview_index.erl b/src/couch_mrview/src/couch_mrview_index.erl
index 1bfdb2818..51777480c 100644
--- a/src/couch_mrview/src/couch_mrview_index.erl
+++ b/src/couch_mrview/src/couch_mrview_index.erl
@@ -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