nickva commented on code in PR #5132:
URL: https://github.com/apache/couchdb/pull/5132#discussion_r1678730552


##########
src/couch/src/couch_bt_engine_header.erl:
##########
@@ -269,14 +270,14 @@ upgrade_epochs(#db_header{} = Header) ->
                 % was always an implicit assumption that a file was
                 % owned since eternity by the node it was on. This
                 % just codifies that assumption.
-                [{node(), 0}];
-            [{Node, _} | _] = Epochs0 when Node == node() ->
+                [{Node, 0}];
+            [{Node, S} | _] = Epochs0 when Header#db_header.update_seq >= S ->
                 % Current node is the current owner of this db
                 Epochs0;
-            Epochs1 ->
+            [{_OtherNode, S} | _] = Epochs1 when Header#db_header.update_seq 
>= S ->

Review Comment:
   This will crash with a case clause in update_seq < S, which is usually what 
we'd want.  I wonder if it exposes enough details in the logs in case that does 
happen. What the sequence S is, what the update_seq is. Maybe some details from 
the header we just opened (the uuid?). Just to have enough bit in the crash to 
figure out what happened if we get a report.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to