mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: no need to save dummy entry into stable storage
This commit is contained in:
parent
b2d686495c
commit
0f070f3d2d
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user