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

step down when leader removes itself #77

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

erikgrinaker
Copy link
Contributor

@erikgrinaker erikgrinaker commented Jun 14, 2023

NB: This behavior was later gated behind a config option in #79.


This patch causes a leader to step down when it removes itself from the group, becoming a follower in the current term. We don't want a removed leader to remain a leader: it no longer accepts proposals, so if it keeps heartbeating then the group is effectively stuck.

Signed-off-by: Erik Grinaker [email protected]

cc @tbg @pavelkalinnikov

@tbg tbg requested a review from ahrtr June 26, 2023 07:51
@ahrtr
Copy link
Member

ahrtr commented Jun 26, 2023

@erikgrinaker please rebase this PR, I will take a look tomorrow.

This patch causes a leader to step down when it removes itself from the
group, becoming a follower in the current term. We don't want a removed
leader to remain a leader: it no longer accepts proposals, so if it
keeps heartbeating then the group is effectively stuck.

Signed-off-by: Erik Grinaker <[email protected]>
@erikgrinaker erikgrinaker force-pushed the remove-leader-step-down branch from 507495e to 72d62a1 Compare June 26, 2023 16:02
Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

LGTM

@ahrtr ahrtr added this to the v3.6.0 milestone Jun 26, 2023
@ahrtr ahrtr merged commit 4abd9e9 into etcd-io:main Jun 26, 2023
@erikgrinaker
Copy link
Contributor Author

TFTR!

tbg added a commit to tbg/cockroach that referenced this pull request Jul 17, 2023
Picks up

- etcd-io/raft#77
- etcd-io/raft#79 (essentially an off-by-default for 77)
- etcd-io/raft#82
- etcd-io/raft#81 (needed for cockroachdb#105797)

Epic: none
Release note: None
@ahrtr ahrtr mentioned this pull request Jul 24, 2023
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