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
force-leave does not remove the failed node from the raft voters list #6856
Comments
Hi @andriytk. We took a look at this issue and have some questions and thoughts. The In the scenario you provide, it seems that the end goal is to restore a working Consul cluster. Why use |
Hi @crhino, thanks for your reply. You are right, the end goal is to restore a working Consul cluster. The problem is that we need to start the new server node with the same node name of the failed one. But Consul will refuse it since this node name is already registered by the different node id. (The symptoms are similar to #4741.) So we need some mechanism to clean up this stale node with its id from the Consul brain. It seems natural that the |
@andriytk I spent some time today reproducing this and reading the issue you linked and its associated fix. I see that the issue really boils down to the fact that the cluster ends up losing raft quorum and thus cannot update its state (otherwise #5485 would work as intended). I see where you are coming from with |
Yes. That's exactly matches with what I mentioned in the description. Thank you @crhino for looking at it. |
Just realized that in this scenario it is actually impossible for Modifying the raft voters equates to asking Raft to make a membership change, and membership changes must be committed in the Raft log to take effect (Raft paper Section 6). Thus, we must recover the cluster before making any changes to membership. I think there is still an interesting situation here with failing to register a node with the same name after recovering the cluster, but I don't think |
Found this issue because my cluster is in the same place. I misconfigured a consul instance with the ip of "127.0.0.1:8500". Now, I have 4 raft peers, 1 of which is that broken one. The others can't figure out a leader b/c the call to that other nodeid is failing due to timeout. There seems to be no mechanism to recover. We have to have a mechanism to force that out of raft consensus, even if it's EDIT: It seems like you can recover from this. https://justin.abrah.ms/2023-07-20-consul-leader-election-issues.html (tl;dr, use peers.json) |
Overview of the Issue
force-leave
command does not remove the failed node from the list of raft voters in a case when the quorum is lost. From another side, the gracefulleave
in a similar scenario does not cause the loss of the quorum in the first place and works fine.Reproduction Steps
-bootstrap-expect=1
.consul force-leave <crashed-node>
on the alive node.It seems natural to expect that
force-leave
would remove the failed node from the raft voters and the quorum would be restored (like in the case with graceful leave), but it does not and the cluster effectively remains stuck.(Tested on 1.5.3, 1.6.1 and 1.6.2 versions.)
The text was updated successfully, but these errors were encountered: