Skip to content

Commit

Permalink
checker: fix the conflict between tiflash learner and location labels (
Browse files Browse the repository at this point in the history
…tikv#6660)

close tikv#6662

Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed Dec 1, 2023
1 parent ab9917b commit 6ef2dbd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/schedule/checker/rule_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,13 @@ func (c *RuleChecker) fixBetterLocation(region *core.RegionInfo, rf *placement.R
isWitness := rf.Rule.IsWitness && c.isWitnessEnabled()
// If the peer to be moved is a witness, since no snapshot is needed, we also reuse the fast failover logic.
strategy := c.strategy(region, rf.Rule, isWitness)
regionStores := c.cluster.GetRegionStores(region)
oldStore := strategy.SelectStoreToRemove(regionStores)
ruleStores := c.getRuleFitStores(rf)
oldStore := strategy.SelectStoreToRemove(ruleStores)
if oldStore == 0 {
return nil, nil
}
var coLocationStores []*core.StoreInfo
regionStores := c.cluster.GetRegionStores(region)
for _, s := range regionStores {
if placement.MatchLabelConstraints(s, rf.Rule.LabelConstraints) {
coLocationStores = append(coLocationStores, s)
Expand Down

0 comments on commit 6ef2dbd

Please sign in to comment.