Просмотр исходного кода

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.
Yicheng Qin 11 лет назад
Родитель
Сommit
551a56fb98
1 измененных файлов с 0 добавлено и 4 удалено
  1. 0 4
      raft/node.go

+ 0 - 4
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