From 551a56fb98050550df9337cf4bae36e6a7d85516 Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Tue, 2 Dec 2014 12:08:09 -0800 Subject: [PATCH] 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. --- raft/node.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/raft/node.go b/raft/node.go index 81d1fdad5..807744a3d 100644 --- a/raft/node.go +++ b/raft/node.go @@ -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