Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Restoring node from a snapshot and bootstrap failure.

39 views
Skip to first unread message

AJ

unread,
Nov 3, 2024, 3:59:01 PM11/3/24
to raft-dev
I am trying to test the snapshot restore functionality, where, the node's snapshot folder is maintained after the node shuts down. 

        rn.Node().Shutdown()

After this, a new node is created with the same previously shutdown node Id. So the idea is node can boot/restore from the existing snapshot (not sure if this the corret restore flow). 

However, I am getting the error message -- error="bootstrap only works on new clusters" 

Can you please elaborate on this error - error="bootstrap only works on new clusters" and if this is the correct way to restore? Let me know if we need more debug data. 

Thanks, 
AJ. 

Philip O'Toole

unread,
Nov 3, 2024, 5:08:47 PM11/3/24
to raft...@googlegroups.com
You seem to be asking questions specific to the Hashicorp implementation of Raft, though this mailing list tends to be more about Raft in general. Have you read their docs? They are actually pretty good.


I also suggest you look at the two projects I have built on the Hashicorp Raft implementation, perhaps they will help you work with the library.



--
You received this message because you are subscribed to the Google Groups "raft-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/raft-dev/48ed595a-a22d-4468-b3bc-61c8725c5267n%40googlegroups.com.

AJ

unread,
Nov 4, 2024, 2:20:27 AM11/4/24
to raft-dev
Thanks. I have referred to the API guide. It says that bootstrap API should only be called at the beginning of the time. 
Upon checking more with the RAFT code I found that if the index or the snapshot already exists for the node, the node bootstrap fails. 
When I bypass the bootstrap, then the node does not become the leader and the cluster is not formed. 
How to deal with such situation? Is there a way to promote the node, whose bootstrap is not called, to be the leder? 

Philip O'Toole

unread,
Nov 4, 2024, 6:55:06 AM11/4/24
to raft...@googlegroups.com
What problem are you trying to solve?

AJ

unread,
Nov 4, 2024, 12:02:37 PM11/4/24
to raft-dev
I am trying to boot up the node having a previous snapshot and make it part of the cluster (either as a leader or follower). Assuming every node of the cluster has its previous snapshot folder, each does not call the bootstrap, how the cluster will be formed? 
I see many snapshot sink and store APIs but I have not explored them all. 

Philip O'Toole

unread,
Nov 4, 2024, 1:01:55 PM11/4/24
to raft...@googlegroups.com
Don't call Bootstrap if there is pre-existing state. Just called NewRaft, and pass it the directory and same node ID.


Reply all
Reply to author
Forward
0 new messages