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


##########
src/fabric/src/fabric_view_changes.erl:
##########
@@ -425,6 +425,15 @@ pack_seqs(Workers) ->
     Opaque = couch_util:encodeBase64Url(?term_to_bin(SeqList, [compressed])),
     ?l2b([integer_to_list(SeqSum), $-, Opaque]).
 
+% When we get sequence before the split, we'll fill in the missing (now split)
+% ranges with a special {split, OldNodeUUid} marker. However, when sequences
+% are emitted in the changes API, that will make the N- prefix (SeqSum) bounce
+% around from higher to lower numbers, while users expect those to be mostly
+% incrementing. So take a conservative approach and assume it will be full
+% rewind for that ramge, and use 0 for that range. This is a purely cosmetic
+% thing, when we decode the sequence that prefix gets thrown away anyway.
+%
+seq({Seq, {split, <<_/binary>>}, _Node}) when is_integer(Seq) -> 0;

Review Comment:
   good idea to rename it and good point about the replicator



##########
src/fabric/src/fabric_view_changes.erl:
##########
@@ -425,6 +425,15 @@ pack_seqs(Workers) ->
     Opaque = couch_util:encodeBase64Url(?term_to_bin(SeqList, [compressed])),
     ?l2b([integer_to_list(SeqSum), $-, Opaque]).
 
+% When we get sequence before the split, we'll fill in the missing (now split)
+% ranges with a special {split, OldNodeUUid} marker. However, when sequences
+% are emitted in the changes API, that will make the N- prefix (SeqSum) bounce
+% around from higher to lower numbers, while users expect those to be mostly
+% incrementing. So take a conservative approach and assume it will be full
+% rewind for that ramge, and use 0 for that range. This is a purely cosmetic

Review Comment:
   oops, good catch!



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