Skip to content

Commit

Permalink
During shutdown, generate snapshot before closing raft node. (#5476)
Browse files Browse the repository at this point in the history
This will prevent trySnapshot from trying to send a range to the index
range channel before it's closed.
  • Loading branch information
martinmr committed May 22, 2020
1 parent 8b579a6 commit cfbcf2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dgraph/cmd/zero/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,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...")
Expand Down

0 comments on commit cfbcf2b

Please sign in to comment.