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

raft: implement leader steps down #3866

Closed
xiang90 opened this issue Nov 14, 2015 · 3 comments
Closed

raft: implement leader steps down #3866

xiang90 opened this issue Nov 14, 2015 · 3 comments

Comments

@xiang90
Copy link
Contributor

xiang90 commented Nov 14, 2015

From CONSENSUS: BRIDGING THEORY AND PRACTICE by diego.

A server might be in the leader state, but if it isn’t the current leader, it could be needlessly delaying client requests. For example, suppose a leader is partitioned from the rest of the cluster, but it can still communicate with a particular client. Without additional mechanism, it could delay a request from that client forever, being unable to replicate a log entry to any other servers. Meanwhile, there might be another leader of a newer term that is able to communicate with a majority of the cluster and would be able to commit the client’s request.

Thus, a leader in Raft steps down if an election timeout elapses without a successful round of heartbeats to a majority of its cluster; this allows clients to retry their requests with another server.

This is important to etcd since the pervious leader needs to cancel all connected watchers to prevent forever waiting.

/cc @bdarnell @gyuho

@xiang90 xiang90 self-assigned this Nov 14, 2015
@xiang90 xiang90 added this to the v2.3.0 milestone Nov 14, 2015
@gyuho
Copy link
Contributor

gyuho commented Nov 14, 2015

Just to clarify, is this issue about improving the watch(er) implementation? Or do we need change on client implementation as well? Thanks,

@xiang90
Copy link
Contributor Author

xiang90 commented Nov 14, 2015

Just to clarify, is this issue about improving the watch(er) implementation?

First, we need to improve raft. So that the leader can actually step down itself. Second, we need to improve watch implementation: if a server is partitioned, it should cancel all its watchers to avoid forever watching. Third, the new lease feature also needs leader stepping down.

Or do we need change on client implementation as well? Thanks,

I do not have plan for client side implementation right now.

@gyuho
Copy link
Contributor

gyuho commented Nov 14, 2015

Makes sense. Thanks for clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants