This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/main by this push:
     new 89210c0fe Always commit if we upgrade 2.x view files
89210c0fe is described below

commit 89210c0fe7526132abedc15ee037a345fb1d21e5
Author: Nick Vatamaniuc <vatam...@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

Reply via email to