fix replication requests exceeding maxRoundWindow + splitting resends#431
Open
jadalsmail wants to merge 9 commits into
Open
fix replication requests exceeding maxRoundWindow + splitting resends#431jadalsmail wants to merge 9 commits into
jadalsmail wants to merge 9 commits into
Conversation
7261a83 to
a70872d
Compare
jadalsmail
commented
Jul 6, 2026
samliok
reviewed
Jul 7, 2026
samliok
reviewed
Jul 8, 2026
yacovm
reviewed
Jul 8, 2026
yacovm
left a comment
Collaborator
There was a problem hiding this comment.
I also want to review this change before it gets merged so please don't merge it yet
Collaborator
Can we please have a more descriptive and elaborate PR description? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
In resendReplicationRequests, timed-out sequences were compressed into contiguous segments and each segment was sent whole to a single node, which can be larger than maxRoundWindow. Thus, nodes drop such requests without responding, so a lagging node would resend the same oversized request forever and never catch up.
initial requests and timed-out retries now share a single send path. A new function, BatchSequences, which distributes seqs as evenly as possible among nodes, returning one batch per node share. Every batch contains at most maxSize sequences.
We also introduce a new variable, MaxRoundRequests, which is the max number of rounds or sequences that fit in one replication request. Every batch is capped at this size by construction. It is set to 10 to match DefaultMaxRoundWindow
Removed: CompressSequences, DistributeSequenceRequests, and the Segment type (plus their tests). the segment/range model they implemented is replaced by batching, and requests may now contain non-contiguous sequences (responders sort incoming requests).
Also, unit test + table tests (for BatchSequences) for testing this functionality were added.