1
0
Fork 0

Checkpoint database during Recovery

master
Philip O'Toole 1 year ago
parent a9e895bee2
commit ab6ca783e1

@ -1948,7 +1948,10 @@ func RecoverNode(dataDir string, logger *log.Logger, logs raft.LogStore, stable
// Create a new snapshot, placing the configuration in as if it was
// committed at index 1.
fsmSnapshot := snapshot.NewFullSnapshot(tmpDBPath)
if err := db.Checkpoint(checkpointTimeout); err != nil {
return fmt.Errorf("failed to checkpoint database: %s", err)
}
fsmSnapshot := snapshot.NewFullSnapshot(tmpDBPath) // tmpDBPath contains full state now.
sink, err := snaps.Create(1, lastIndex, lastTerm, conf, 1, tn)
if err != nil {
return fmt.Errorf("failed to create snapshot: %v", err)

Loading…
Cancel
Save