schedule: skip slow/evicted stores in hot region scheduling (#10946)#10972
schedule: skip slow/evicted stores in hot region scheduling (#10946)#10972ti-chi-bot wants to merge 1 commit into
Conversation
Signed-off-by: lucasliang <nkcs_lykx@hotmail.com>
|
This cherry pick PR is for a release branch and has not yet been approved by triage owners. To merge this cherry pick:
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@LykxSassinator: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bufferflies, LykxSassinator, rleungx The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/retest |
This is an automated cherry-pick of #10946
What problem does this PR solve?
Issue Number: Close #10936
Hot-region scheduling can still choose a destination store that has already
been marked as unsuitable for hot traffic, such as slow stores, stopping
stores, or stores evicted by slow-trend detection.
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs/pingcap/docs-cn:pingcap/tiup:Release note
Deep Review
Problem Summary
#10936is about hot-region scheduling still selecting destination stores that PD has already marked as unsuitable for receiving hot-region traffic.StoreStateFilterregionTargetlogic would also change unrelatedMoveRegionusers such as replica repair and generic balance-region flows.Solution Walkthrough
pkg/schedule/filter/filters.go:572-600addsNewHotRegionEvictedTargetFilter, a target-only filter that rejects stores when any of these store-state flags are set:store.EvictedAsSlowStore()store.EvictedAsStoppingStore()store.IsEvictedAsSlowTrend()pkg/schedule/schedulers/hot_region_solver.go:564-569wires the new filter into the hot-regionmovePeerdestination path, which covers hot peer relocation.pkg/schedule/schedulers/hot_region_solver.go:585-588also adds the filter to the hot-read move-leader fallback candidate set, which is the non-obvious path that can still materialize as aMoveLeader-style choice inside hot scheduling.pkg/schedule/schedulers/grant_hot_region.go:301-304applies the same filter togrant-hot-regiondestination selection.pkg/schedule/schedulers/shuffle_hot_region.go:156-160applies it toshuffle-hot-regiondestination selection.pkg/schedule/filter/filters_test.go:304-323adds direct coverage for the new filter and verifies all three eviction states.pkg/schedule/schedulers/hot_region_test.go:1333-1422adds scheduler regressions for:StoreStateFilterregionTargetbehavior, so non-hotMoveRegioncallers keep their previous semantics.Findings (ordered by severity)
Costs and Negative Impacts
MoveRegionbehavior.slow-store,stopping-store, andslow-trendeviction states, not onlyslowStoreEvicted.leaderEvicted/"leader-evicted-filter"inpkg/schedule/filter/counter.go:55-86, while the exported constructor name is nowNewHotRegionEvictedTargetFilter. This is a maintainability and observability clarity cost, not a correctness bug.Engineering Rules Check
Questions and Assumptions
Suggested Tests / Validation
pkg/schedule/filter/filters_test.go:304-323andpkg/schedule/schedulers/hot_region_test.go:1333-1422is directionally correct and exercises the two highest-risk solver paths.grant-hot-regionrejecting an evicted destination store.shuffle-hot-regionrejecting an evicted destination store.Summary by CodeRabbit
New Features
Bug Fixes