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:
Yicheng Qin
2014-11-11 16:10:03 -08:00
parent ac77971f99
commit 7dba92dd53
3 changed files with 23 additions and 7 deletions

View File

@ -134,9 +134,6 @@ func (l *raftLog) appliedTo(i uint64) {
}
func (l *raftLog) stableTo(i uint64) {
if i == 0 {
return
}
l.unstable = i + 1
}