Skip to content

NRG: Success signaling & stepdown during catchup #7151

Merged
neilalexander merged 2 commits intomainfrom
maurice/nrg-partial-quorum
Aug 7, 2025
Merged

NRG: Success signaling & stepdown during catchup #7151
neilalexander merged 2 commits intomainfrom
maurice/nrg-partial-quorum

Conversation

@MauriceVanVeen
Copy link
Copy Markdown
Member

@MauriceVanVeen MauriceVanVeen commented Aug 6, 2025

This PR fixes some potential issues with our Raft replication:

  • Could technically do a divide by zero in n.Applied(index), now guarding against that. As well as recalculating n.bytes after n.truncateWAL(term, index).
  • Grab ae.lterm from the append entry earlier, and stepdown from leader or candidate if a higher term is detected during catchup.
  • Handle case where catchup is canceled but we still receive an entry from a previous catchup, in which case we ignore that entry.
  • Don't signal success/non-success after a mismatch. This could result in wrongfully providing quorum when having an outdated log.

Signed-off-by: Maurice van Veen github@mauricevanveen.com

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner August 6, 2025 14:37
Copy link
Copy Markdown
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@neilalexander neilalexander merged commit 9ba82c9 into main Aug 7, 2025
48 checks passed
@neilalexander neilalexander deleted the maurice/nrg-partial-quorum branch August 7, 2025 08:53
neilalexander added a commit that referenced this pull request Aug 13, 2025
Includes the following:

- #7140
- #7142
- #7145
- #7150
- #7151
- #7154
- #7156
- #7122
- #7166 (excluding the Go
version bump)
- #7162
- #7165

Signed-off-by: Neil Twigg <neil@nats.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants