diff --git a/raft/raft.go b/raft/raft.go index 25765cf78..3aa645b63 100644 --- a/raft/raft.go +++ b/raft/raft.go @@ -1428,6 +1428,7 @@ func (r *raft) restore(s pb.Snapshot) bool { // code here and there assumes that r.id is in the progress tracker. found := false cs := s.Metadata.ConfState + for _, set := range [][]uint64{ cs.Voters, cs.Learners, @@ -1438,6 +1439,9 @@ func (r *raft) restore(s pb.Snapshot) bool { break } } + if found { + break + } } if !found { r.logger.Warningf(