Skip to content

Commit

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

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

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
rleungx and ti-chi-bot[bot] committed Nov 23, 2023
1 parent fc578aa commit 0222af0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/schedule/checker/rule_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ func (c *RuleChecker) CheckWithFit(region *core.RegionInfo, fit *placement.Regio
return
}

// 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 0222af0

Please sign in to comment.