raft: no need to save dummy entry into stable storage

release-2.0
Yicheng Qin 2014-11-26 14:04:56 -08:00
parent b2d686495c
commit 0f070f3d2d
1 changed files with 2 additions and 2 deletions

View File

@ -271,8 +271,8 @@ func (l *raftLog) maybeCommit(maxIndex, term uint64) bool {
func (l *raftLog) restore(s pb.Snapshot) {
l.committed = s.Metadata.Index
l.unstable.offset = l.committed
l.unstable.entries = []pb.Entry{{Index: s.Metadata.Index, Term: s.Metadata.Term}}
l.unstable.offset = l.committed + 1
l.unstable.entries = nil
l.unstable.snapshot = &s
}