Forced bootstrap from new leader #1360
-
Hey, I am not sure how exactly I got into this situation, but during testing / local dev, I was able to get the cluster in a state, where it would not come up, if one node was missing, that was the leader before. Let me try to explain the situation: Assuming I have 3 nodes which have successfuly formed an To break it down a bit better, this was (kind of) the situation I got into during testing:
It of course makes a lot of sense that Node 1 and 2 would try to connect to Node 3 to reach a consistent state and not potentially loose any data. But, what if Node 3 got destroyed and it just cannot come back? In this case, I want to make it possible to have something like a forced bootstrap or basically reset the last known leader to What I was thinking about is to add an option during startup that would delete the last saved Is this something that could work, or can I do this in some other way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Node 1 and node 2 should not try to connect to node 3. Could you share logs showing the network traffic? Usually, if nodes 1 and 2 don't receive any messages from node 3 for a while, they will start an election to determine a leader. Can you provide logs showing what these nodes did during startup? Typically the saved vote will be updated to a candidate vote. Regarding data recovery, OpenRaft does support recovering a node after wiping its data, to enable this feature:
|
Beta Was this translation helpful? Give feedback.
Node 1 and node 2 should not try to connect to node 3. Could you share logs showing the network traffic?
Usually, if nodes 1 and 2 don't receive any messages from node 3 for a while, they will start an election to determine a leader. Can you provide logs showing what these nodes did during startup? Typically the saved vote will be updated to a candidate vote.
Regarding data recovery, OpenRaft does support recovering a node after wiping its data, to enable this feature:
In OpenRaft 0.9:
This requires enabling the
loosen-follower-log-revert
feature flag. Without this flag, wiping a node's data and restarting it will cause the leader to panic. https://docs.rs/openraft/latest/openraft/docs/…