-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Suggestion: control over leader identity #218
Comments
I'm happy to receive any feedback on the idea in general and on the proposed PRs in particular. Thank you! |
#222 seems to be working very well on my environment. |
Have you seen the v2 branch which has support for non-voting members? it might be a better fit for the problem you're trying to solve. |
@superfell thank you, I was not aware of
My current implementation/use allows for something like: This is invoked on the leader, and the leader sends a I'm unsure whether |
|
If I read correctly between the lines you will not merge #222 ; if this is the case, please let me know and I will close it. Having said that I'm running this in production and very easily controlling the identity of the raft cluster's leader. e.g. I have a cronjob running every 10 minutes checking out my production environment, figuring out which is the "active" (aka "main") data center ; it then looks at my raft cluster:
This is done with minimal changes to the existing code. Thank you for your consideration. |
Gentle ping. Please let me know if you at all consider this for inclusion or not. |
@shlomi-noach Sorry for the delayed response. We've made quite a few changes in library-v2-stage-one for Consul/Nomad including improvements like non voting servers, proper fsyncing of snapshots, the new address provider abstraction, and other improvements. As you can imagine, it is no fun keeping changes in sync across three different branches. We are planning to tag the current master branch as 0.1.0, and then merge library-v2-stage-one into master and tag that as 1.0.0. This will happen sometime next week. We discussed your proposal internally, and like @superfell points out, AddVoter and DemoteVoter help you achieve the same results. Note that both methods are implemented as configuration change requests, and so calling DemoteVoter on the leader will cause it to step down, and it can only become a candidate (or subsequently a leader) again via AddVoter. Feel free to try out the v2-stage-one branch for this, or by early next week you'll be able to get this in the master branch. Hope this helps. |
@preetapan thank you for your review! |
I find it convenient that I could have control over the identity of the leader in a stable group. For example, I may be running cross-DC nodes (in an attempt to fight fencing), and would prefer the leader to normally run from a specific, local, "active" DC to where most operations are running.
Or, as another example, I might have a 3-node group, but only 2 are full blown provisioned machines, and the 3rd is only a raft mediator.
Ideally, I would like to be able to point to a specific node and ask "become the leader". I can see various ways to achieve this:
Candidate
state (up toquorum - 1
nodes are safe to run this)Candidate
state for a bound period of timeI will try some pull-requests to support these ideas. I'm aware that my understanding of Raft is limited, and will work with what makes sense to me following existing use patterns.
Related: #211
The text was updated successfully, but these errors were encountered: