diff --git a/dgraph/cmd/zero/run.go b/dgraph/cmd/zero/run.go index 5f770c69805..a350ad95506 100644 --- a/dgraph/cmd/zero/run.go +++ b/dgraph/cmd/zero/run.go @@ -294,11 +294,12 @@ func run() { _ = httpListener.Close() // Stop Raft. st.node.closer.SignalAndWait() + // Try to generate a snapshot before the shutdown. + st.node.trySnapshot(0) // Stop Raft store. store.Closer.SignalAndWait() // Stop all internal requests. _ = grpcListener.Close() - st.node.trySnapshot(0) }() glog.Infoln("Running Dgraph Zero...")