raft: update unstable when calling stableTo with 0
It should update unstable in this case because it may happen that raft only writes entry 0 into stable storage.
This commit is contained in:
@ -298,9 +298,7 @@ func (n *node) run(r *raft) {
|
||||
if prevHardSt.Commit != 0 {
|
||||
r.raftLog.appliedTo(prevHardSt.Commit)
|
||||
}
|
||||
if prevLastUnstablei != 0 {
|
||||
r.raftLog.stableTo(prevLastUnstablei)
|
||||
}
|
||||
r.raftLog.stableTo(prevLastUnstablei)
|
||||
advancec = nil
|
||||
case <-n.done:
|
||||
return
|
||||
|
Reference in New Issue
Block a user