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

Leader does not step down? #597

Open
drmingdrmer opened this issue Nov 5, 2022 · 1 comment
Open

Leader does not step down? #597

drmingdrmer opened this issue Nov 5, 2022 · 1 comment

Comments

@drmingdrmer
Copy link
Member

What about allowing the leader to continue acting as a leader after a membership config without the leader being committed?

https://github.com/drmingdrmer/consensus-bugs/#raft-suboptimal-leader-step-down

In the raft paper:
6. Cluster membership changes

The second issue is that the cluster leader may not be part of the new configuration.
In this case, the leader steps down (returns to follower state) once it has committed the C_{new} log entry.

But the leader does NOT have to give up leadership:

Despite it should not cast a ballot(vote) for other candidates, a learner(AKA
non-voter, a node removed from cluster config) can nevertheless be a leader(or
become a candidate) as long as it wants. This non-voting leader:

  • handles write operations in the same way as a normal leader, except the local log store does not count in majority.
  • handles read operations in the same way as a normal leader.

NOTE: A learner(non-voter) does not have to reject vote requests.
Because raft ensures that a candidate using the second-to-last committed config
would never become the leader. Thanks to Gao Xinge.

Improvement

When a leader commits C_{new}, it does NOT give up leadership, but just
keep serving as leader.

This way, membership config log does not need to be dealt with specially by an
implementation. The (non-voting) leader will be removed only if it is required:
by just shutting down the non-voting leader or informing it to transfer its
leadership to another node.

@github-actions
Copy link

github-actions bot commented Nov 5, 2022

👋 Thanks for opening this issue!

Get help or engage by:

  • /help : to print help messages.
  • /assignme : to assign this issue to you.

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

No branches or pull requests

1 participant