mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
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:
commit
b95f135e10
@ -367,10 +367,12 @@ func (n *node) run() {
|
|||||||
// very sound and likely has bugs.
|
// very sound and likely has bugs.
|
||||||
if _, okAfter := r.prs.Progress[r.id]; okBefore && !okAfter {
|
if _, okAfter := r.prs.Progress[r.id]; okBefore && !okAfter {
|
||||||
var found bool
|
var found bool
|
||||||
|
outer:
|
||||||
for _, sl := range [][]uint64{cs.Voters, cs.VotersOutgoing} {
|
for _, sl := range [][]uint64{cs.Voters, cs.VotersOutgoing} {
|
||||||
for _, id := range sl {
|
for _, id := range sl {
|
||||||
if id == r.id {
|
if id == r.id {
|
||||||
found = true
|
found = true
|
||||||
|
break outer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user