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

Updating the leader node and advised heartbeat/election/leaderlease timeouts #250

Closed
JelteF opened this issue Sep 26, 2017 · 4 comments
Closed
Assignees
Labels

Comments

@JelteF
Copy link
Contributor

JelteF commented Sep 26, 2017

I'm working on a procedure to upgrade the nodes in the raft cluster to a new version of the software. This means that also the leader needs to be replaced. Right now we're doing this by just killing the leader and letting raft figure out who the new leader is supposed to be by doing an election. Is this the right way of doing this?

If so, the timeouts in the default configuration seem to be quite high. With a heartbeat timeout and an election timeout of 1 second it seems quite common to have elections that take 2-3 seconds. We're thinking about lowering both to 100ms, to make the election happen quicker.

Do you see any problems with this? And what kind of LeaderLeaseTimeout would you recommend, 50ms or a 100ms as well or something else even?

@JelteF
Copy link
Contributor Author

JelteF commented Sep 26, 2017

Oh, probably important information we're running the nodes in different AWS availability zones in the same region. When measuring the latency between the nodes it is usually below 1ms.

@schristoff schristoff self-assigned this May 2, 2019
@RobbieMcKinstry
Copy link
Contributor

@i0rek is working on a PR for adding leadership transfer. For now, your approach is correct, but you might want to look at the transfer leadership stuff when it lands (should be soon).

@schristoff
Copy link
Contributor

Hey @JelteF , thank you so much for bringing this up!
The way you're doing it currently is correct, and @i0rek is working on a PR here to allow a leader to be chosen before transfer.
For suggestions on timeouts, that is really dependent on your set up. Since you're measuring your latency to be pretty low as you stated I would recommend changing the LeaderLeaseTimeout to 100ms before 50ms.
One key thing to watch is that's your resource utilization when you do this. Since you'll be sending a heartbeat more frequently, and this can add more stress on the machines.
I'd love to hear your findings to see if decreasing the timeout gave you any noticeable difference in your resource utilization.

I'll be closing this issue, but feel free to keep the discussion going.

@RobbieMcKinstry
Copy link
Contributor

As Sarah pointed out, when you're thinking about resource utilization, consider our Lifeguard work. We specifically looked at the effects of having a CPU-bound process that was alive, but couldn't respond to heartbeats (in the form of membership gossip) because the CPU was already saturated, producing a false positive in the failure detector. I suspect that as you lower the heartbeat frequency, you may encounter more of this thrashing if your nodes are doing enough work.

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

No branches or pull requests

3 participants