Skip to content

Commit

Permalink
Update RAFT checkpoint when doing a clean shutdown. (dgraph-io#5097)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmr authored and dna2github committed Jul 18, 2020
1 parent 377b8d5 commit 8c3c570
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions worker/worker.go
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 8c3c570

Please sign in to comment.