Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NRG (2.11): Vote request cancels catchup, new leader could have rejected subsequent catchup messages #6072

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

MauriceVanVeen
Copy link
Member

Antithesis triggered a case where:

  • a follower (S0) is behind and triggers catchup from the leader (S2)
  • another follower (S1) triggers leader election
  • the follower (S0) allows follower (S1) to become leader
  • the leader (S2) sends a new message, which new leader (S1) rejects because it's on a higher term
  • the follower (S0) now receives above message that new leader (S1) rejected, providing previous leader (S2) with quorum
  • the new leader (S1) rejected that message, so previous leader (S2) has now desynced since it applied the message

This is solved by canceling catchup once a leader election happens for a higher term. The new leader will then resume our catchup once it's elected.

Signed-off-by: Maurice van Veen [email protected]

@MauriceVanVeen MauriceVanVeen changed the title NRG: Vote request cancels catchup, new leader could have rejected subsequent catchup messages NRG (2.11): Vote request cancels catchup, new leader could have rejected subsequent catchup messages Nov 4, 2024
server/raft.go Outdated Show resolved Hide resolved
…sequent catchup messages

Signed-off-by: Maurice van Veen <[email protected]>
@MauriceVanVeen MauriceVanVeen force-pushed the maurice/desync-with-vote-req-during-catchup branch from 552658b to 0f7cf3d Compare November 4, 2024 13:35
Copy link
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 marked this pull request as ready for review November 4, 2024 15:14
@neilalexander neilalexander requested a review from a team as a code owner November 4, 2024 15:14
Copy link
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

@derekcollison derekcollison merged commit 633bb94 into main Nov 4, 2024
5 checks passed
@derekcollison derekcollison deleted the maurice/desync-with-vote-req-during-catchup branch November 4, 2024 16:21
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