raft: prev should be set only when we sucessfully send out rd to the channel
This commit is contained in:
@ -106,7 +106,6 @@ func (n *Node) run(r *raft) {
|
||||
|
||||
if rd.containsUpdates(prev) {
|
||||
readyc = n.readyc
|
||||
prev = rd
|
||||
} else {
|
||||
readyc = nil
|
||||
}
|
||||
@ -122,6 +121,7 @@ func (n *Node) run(r *raft) {
|
||||
case readyc <- rd:
|
||||
r.raftLog.resetNextEnts()
|
||||
r.raftLog.resetUnstable()
|
||||
prev = rd
|
||||
r.msgs = nil
|
||||
case <-n.done:
|
||||
return
|
||||
|
Reference in New Issue
Block a user