Skip to content

Commit

Permalink
schedule: fix panic when switching placement rules (tikv#7415) (tikv#…
Browse files Browse the repository at this point in the history
…7422)

close tikv#7414

Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>

Co-authored-by: Ryan Leung <[email protected]>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 10, 2024
1 parent 064986b commit e878b62
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/schedule/checker/rule_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ func (c *RuleChecker) CheckWithFit(region *core.RegionInfo, fit *placement.Regio
panic("cached should be used")
})

// the placement rule is disabled
if fit == nil {
return
}

// If the fit is calculated by FitRegion, which means we get a new fit result, thus we should
// invalid the cache if it exists
c.ruleManager.InvalidCache(region.GetID())
Expand Down

0 comments on commit e878b62

Please sign in to comment.