mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: prev should be set only when we sucessfully send out rd to the channel
This commit is contained in:
parent
57ea72d3c4
commit
0060c0749a
@ -106,7 +106,6 @@ func (n *Node) run(r *raft) {
|
|||||||
|
|
||||||
if rd.containsUpdates(prev) {
|
if rd.containsUpdates(prev) {
|
||||||
readyc = n.readyc
|
readyc = n.readyc
|
||||||
prev = rd
|
|
||||||
} else {
|
} else {
|
||||||
readyc = nil
|
readyc = nil
|
||||||
}
|
}
|
||||||
@ -122,6 +121,7 @@ func (n *Node) run(r *raft) {
|
|||||||
case readyc <- rd:
|
case readyc <- rd:
|
||||||
r.raftLog.resetNextEnts()
|
r.raftLog.resetNextEnts()
|
||||||
r.raftLog.resetUnstable()
|
r.raftLog.resetUnstable()
|
||||||
|
prev = rd
|
||||||
r.msgs = nil
|
r.msgs = nil
|
||||||
case <-n.done:
|
case <-n.done:
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user