NRG: Parallel catchups can truncate committed#7424
Merged
neilalexander merged 1 commit intomainfrom Oct 13, 2025
Merged
Conversation
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
neilalexander
added a commit
that referenced
this pull request
Oct 13, 2025
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.
Follow-up of a small bug introduced in #7209 that could result in desync under niche conditions.
If a follower is behind it will request catchup from the leader. The leader however could send more catchup data than the follower requested by sending it up to the last known entry. The follower will then mark catchup as finished when it has received what it knew to be all entries, but it may receive more messages from the leader still.
If multiple catchups were running in parallel, this could result in the follower marking the catchup as complete but then still letting an append entry from another catchup through that could truncate the WAL for entries that were already responded to as "can be committed".
This PR simply adds a small guard to not allow truncation from a catchup entry if catchup has completed. Later on we'll need to look at how to improve catchup in general, especially with fast batch ingest that will require Raft catchup to be faster than that as well.
Signed-off-by: Maurice van Veen github@mauricevanveen.com