Skip to content

Commit

Permalink
Update RAFT checkpoint when doing a clean shutdown. (#5097)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmr authored Apr 7, 2020
1 parent f38073a commit 98769a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ func BlockingStop() {
glog.Infof("Stopping group...")
groups().closer.SignalAndWait()

// Update checkpoint so that proposals are not replayed after the server restarts.
glog.Infof("Updating RAFT state before shutting down...")
if err := groups().Node.updateRaftProgress(); err != nil {
glog.Warningf("Error while updating RAFT progress before shutdown: %v", err)
}

glog.Infof("Stopping node...")
groups().Node.closer.SignalAndWait()

Expand Down

0 comments on commit 98769a6

Please sign in to comment.