Skip to content

Original leader gets reelected after node restart #472

Closed Answered by michaelklishin
luos asked this question in Q&A
Discussion options

You must be logged in to vote

If between the moment you stop node A and when node A comes back there were no Raft log updates (e.g. no messages published or consumed + acknowledged), both replicas will have the same log state and the primary difference should be the election term.

Raft's leader election voting (candidate selection) has a random component to it and can fail (end up in a split vote) and retry. When an older leader shows up in the process, that can produce a behavior you are observing.

And the randomness in candidate selection during a vote probably explains why this happens to some queues but not all.

Most importantly: the data in those QQs should still be safe.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by luos
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants