-
Notifications
You must be signed in to change notification settings - Fork 166
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
New leader election never triggered #1329
Comments
👋 Thanks for opening this issue! Get help or engage by:
|
If a Follower does not receive an The maximum time a Follower waits before starting an election is defined by openraft/openraft/src/core/raft_core.rs Line 1559 in 7bebecb
To investigate your issue, could you provide the DEBUG-level logs from a Follower after shutting down the Leader? These logs could reveal the root cause of the problem. |
For some reason, it doesn't work in tests, but it works when the nodes run in Docker. Most likely, the issue is on my side. Could you confirm or deny the statement: If I have a 3-node cluster, at least 2 nodes should be alive to reach consensus. Does this mean that if 2 nodes are dead, I will experience data loss? And if I have a 5-node cluster, should at least 3 nodes be alive? Is it possible to switch to a 1 node cluster if other nodes fail? Does this make sense or is it better to just restart the nodes that crashed? I'm just interested in the theoretical part. |
Yes. If 2 nodes are down, there won't be data loss (durability is maintained as soon as the 2 nodes go back online), but the cluster will be unavailable (availability loss). If you have 5 nodes, you can tolerate 2 nodes being offline. And yes, there must be at least 3 nodes for the cluster to serve.
You can switch a 3-node cluster to a 1-node cluster using If by "crash" you mean data being erased, this is undefined behavior for a Raft cluster. However, you can restart an empty node, and the data will be replicated from the leader to the new empty node. Note, though, that in such scenarios, there is no guarantee against data loss. |
Is it okay if I come up with a PR to improve the documentation in the code and in the FAQ? @drmingdrmer |
Of cause! Thank you! |
Hey!
I've created a simple MVP using the provided examples. I've started three nodes to act as voters, and they successfully elect a leader. However, when I terminate the leader, a new election does not occur even in 5 minutes, in my opinion this should be well documented.
My config:
Could you clarify on what basis should the re-election of the leader take place? @drmingdrmer
I can't use the membership change here because the leader is down and the request will be forwarded to the leader.
Expected behavior
The new leader should be elected automatically.
Actual behavior
The leader was not elected. In the logs, I see "result=Unreachable node errors," which is obvious, but I don't see any indication that the nodes are trying to initiate a leader change.
The text was updated successfully, but these errors were encountered: