Merge pull request #11861 from tedyu/node-run-found

raft: break out of nested loop when raft id is found
This commit is contained in:
Gyuho Lee
2020-05-09 23:05:26 -07:00
committed by GitHub

View File

@@ -367,10 +367,12 @@ func (n *node) run() {
// very sound and likely has bugs.
if _, okAfter := r.prs.Progress[r.id]; okBefore && !okAfter {
var found bool
outer:
for _, sl := range [][]uint64{cs.Voters, cs.VotersOutgoing} {
for _, id := range sl {
if id == r.id {
found = true
break outer
}
}
}