Skip to content

Don't allow a non-voter to start elections #525

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

Merged
merged 4 commits into from
Mar 17, 2025

Conversation

mkuratczyk
Copy link
Contributor

When transfer_leadership is requested, the leader checks whether the desired new leader is a voter and refuses to proceed if it is not. However, the desired new leader should also refuse to proceed, if it doesn't consider itself a voter (the view of the membership may be different on different nodes or might have changed since the old/current leader checked it).

This fixes a behaviour we observed in testing where a newly added member, which was still catching up, was picked to be a new leader and actually became a leader, even though it was still in the promotable state.

When transfer_leadership is requested, the leader checks whether
the desired new leader is a voter and refuses to proceeed if it is not.
However, the desired new leader should also refuse to proceed,
if it doesn't consider itself a voter (the view of the membership
may be different on different nodes or might have changed since
the old/current leader checked it).

This fixes a behaviour we observed in testing where a newly added
member, which was still catching up, was picked to be a new leader
and actually became a leader, even though it was still in the `promotable` state.
It duplicates the functionality of election_timeout,
so let's just call the election_timeout
@mkuratczyk mkuratczyk force-pushed the do-not-call-for-elections-if-you-cannot-vote branch from 73403df to 215611c Compare March 17, 2025 12:19
@kjnilsson kjnilsson merged commit ee45d3d into main Mar 17, 2025
3 checks passed
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