janl commented on code in PR #5558:
URL: https://github.com/apache/couchdb/pull/5558#discussion_r2173821880


##########
src/couch/src/couch_bt_engine.erl:
##########
@@ -809,6 +819,35 @@ set_update_seq(#st{header = Header} = St, UpdateSeq) ->
         needs_commit = true
     }}.
 
+set_drop_seq(#st{header = Header} = St, ExpectedUuidPrefix, NewDropSeq) when
+    is_binary(ExpectedUuidPrefix), is_integer(NewDropSeq), NewDropSeq >= 0
+->
+    CurrentDropSeq = get_drop_seq(St),
+    Uuid = get_uuid(St),
+    ActualUuidPrefix = binary:part(Uuid, 0, byte_size(ExpectedUuidPrefix)),
+    if
+        ExpectedUuidPrefix /= ActualUuidPrefix ->
+            {error, uuid_mismatch};
+        NewDropSeq < CurrentDropSeq ->

Review Comment:
   ah, I didn’t mean to raise an error, but to not write a new header if the 
drop seqs are the same because presumably that value already made it to a 
header the last time we were here. but no bother if edge case.



-- 
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