mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: break out of nested loop when id is found (#11870)
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
This commit is contained in:
parent
6fb3b9e591
commit
7cc2f8a411
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user