Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: bufferflies <1045931706@qq.com>
  • Loading branch information
bufferflies committed Dec 20, 2023
1 parent 5eddb48 commit 0e0bdd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/schedule/checker/rule_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ func (c *RuleChecker) fixOrphanPeers(region *core.RegionInfo, fit *placement.Reg
ruleCheckerRemoveOrphanPeerCounter.Inc()
return operator.CreateRemovePeerOperator("remove-unhealthy-orphan-peer", c.cluster, 0, region, orphanPeer.StoreId)
}
// If there is one extra peer but all the count of all the rule is not satisfied, we should not remove any peer to keep the high available.
// The healthy orphan peer should be the last one to be removed only if there are extra peers to keep the high availablility.
if hasHealthPeer && extra > 0 {
// there already exists a healthy orphan peer, so we can remove other orphan Peers.
ruleCheckerRemoveOrphanPeerCounter.Inc()
Expand Down
2 changes: 1 addition & 1 deletion pkg/schedule/placement/fit.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (f *RegionFit) IsSatisfied() bool {
return len(f.OrphanPeers) == 0
}

// retrun true if the count of the rule is satisfied.
// ExtraCount return the extra count.
func (f *RegionFit) ExtraCount() int {
desired := 0
for _, r := range f.RuleFits {
Expand Down

0 comments on commit 0e0bdd9

Please sign in to comment.