From 98769a6f1cb1e7dc01920bc6c661740995afbdae Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Tue, 7 Apr 2020 14:34:55 -0700 Subject: [PATCH] Update RAFT checkpoint when doing a clean shutdown. (#5097) --- worker/worker.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/worker/worker.go b/worker/worker.go index ad0b8f6afb5..cf11139a24a 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -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()