raft: not call stableTo for restored snapshot

Stable has been set when restoring the snapshot in raftlog, so we don't need
to set it after advance.
This commit is contained in:
Yicheng Qin 2014-12-02 12:08:09 -08:00
parent f34fe6e4ae
commit 551a56fb98

View File

@ -292,10 +292,6 @@ func (n *node) run(r *raft) {
prevHardSt = rd.HardState
}
if !IsEmptySnap(rd.Snapshot) {
if rd.Snapshot.Metadata.Index > prevLastUnstablei {
prevLastUnstablei = rd.Snapshot.Metadata.Index
havePrevLastUnstablei = true
}
prevSnapi = rd.Snapshot.Metadata.Index
}
r.msgs = nil