Skip to content

Commit 482cd9b

Browse files
committed
address comment
Signed-off-by: nolouch <nolouch@gmail.com>
1 parent 0229f17 commit 482cd9b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

pkg/schedule/checker/rule_checker.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -460,14 +460,13 @@ loopFits:
460460
if isUnhealthyPeer(orphanPeer.GetId()) {
461461
ruleCheckerRemoveOrphanPeerCounter.Inc()
462462
return operator.CreateRemovePeerOperator("remove-orphan-peer", c.cluster, 0, region, orphanPeer.StoreId)
463-
} else {
464-
if hasHealthPeer {
465-
// there already exists a healthy orphan peer, so we can remove other orphan Peers.
466-
ruleCheckerRemoveOrphanPeerCounter.Inc()
467-
return operator.CreateRemovePeerOperator("remove-orphan-peer", c.cluster, 0, region, orphanPeer.StoreId)
468-
}
469-
hasHealthPeer = true
470463
}
464+
if hasHealthPeer {
465+
// there already exists a healthy orphan peer, so we can remove other orphan Peers.
466+
ruleCheckerRemoveOrphanPeerCounter.Inc()
467+
return operator.CreateRemovePeerOperator("remove-orphan-peer", c.cluster, 0, region, orphanPeer.StoreId)
468+
}
469+
hasHealthPeer = true
471470
}
472471
}
473472
ruleCheckerSkipRemoveOrphanPeerCounter.Inc()

0 commit comments

Comments
 (0)