janl commented on code in PR #5558:
URL: https://github.com/apache/couchdb/pull/5558#discussion_r2158718123
##########
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:
this implies we are okay with setting drop_seq to the same value again, in
which case we can save ourselves writing a new header maybe?
--
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]