storelimit: synchronize runtime limiters before scheduling - #11214
storelimit: synchronize runtime limiters before scheduling#11214JmPotato wants to merge 2 commits into
Conversation
Refresh v1 limiter rates from in-memory configuration before selecting stores, so exhausted limits recover after configuration updates in the standalone scheduling service. Reuse the synchronization in admission and monolithic PD's eager refresh paths. Publish rates and buckets atomically to keep reads inexpensive, and avoid copying configuration or inserting missing entries during rate lookup. Cover rate transitions and concurrent refresh with regression tests and benchmarks. Close tikv#11201 Signed-off-by: JmPotato <github@ipotato.me>
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
Signed-off-by: JmPotato <github@ipotato.me>
What problem does this PR solve?
Issue Number: close #11201
In standalone scheduling deployments, raising an exhausted store limit can leave the store filtered out: filters inspect the stale limiter, while refreshing its rate requires an operator that those filters prevent from being created.
What is changed and how does it work?
The filter closes the stale-budget loop before operator creation. Existing operator admission and monolithic PD refresh paths continue to perform their own rate checks. The atomic bucket publication is retained because tested lock-based alternatives increased v1 filter time by approximately 1–12%.
Check List
Tests
5abc379473with this change using identical benchmark sources, Go 1.27.1, AMD Ryzen 9 9955HX, and CPU affinity 4–7. The harness is retained in commit ea62dc73fd: extract the benchmark-only diff forpkg/schedule/filter/store_limit_bench_test.go,pkg/schedule/operator/operator_controller_test.go, andpkg/schedule/schedulers/balance_benchmark_test.go, then apply it to both revisions in separate worktrees. Enable failpoints, build package test binaries, then disable failpoints. Run eight rotating samples with-test.run='^$' -test.benchmem -test.cpu=1,4; selectBenchmarkStoreLimitFilterat 150ms,BenchmarkExceedStoreLimitat 300ms, andBenchmarkStoreLimitScheduleat 500ms per sample, and compare with benchstat.Against master, operator budget checks improve by 2.23% in time geomean, with unchanged 704 B/op and 9 allocs/op. All eight v1 filter cases improve by 1.54–3.39%; all filter cases remain at 0 B/op and 0 allocs/op. Full scheduling shows no statistically significant time regression in four cases (time geomean +0.35%).
Scoped
make checkpassed with golangci-lint v2.6.0 under Go 1.25.12 andwithout_dashboard; runtime tests and benchmarks used Go 1.27.1. One earlier run of the existing admission test failed when an already-finished operator was removed before its explicit removal assertion; the subsequent three-run check passed. Ten baseline runs did not reproduce it, so the baseline attribution remains unconfirmed.Side effects
Release note