Skip to content

scheduler: evict hot leader first#9275

Draft
rleungx wants to merge 10 commits into
tikv:masterfrom
rleungx:evict-leader-hot
Draft

scheduler: evict hot leader first#9275
rleungx wants to merge 10 commits into
tikv:masterfrom
rleungx:evict-leader-hot

Conversation

@rleungx

@rleungx rleungx commented Apr 28, 2025

Copy link
Copy Markdown
Member

What problem does this PR solve?

Issue Number: Close #8949

What is changed and how does it work?

Check List

Tests

  • Unit test

Release note

None.

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@ti-chi-bot

ti-chi-bot Bot commented Apr 28, 2025

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot Bot added do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 28, 2025
@codecov

codecov Bot commented Apr 28, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 83.20000% with 21 lines in your changes missing coverage. Please review.

Project coverage is 76.03%. Comparing base (873ea1e) to head (fc4bfdd).
Report is 27 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9275      +/-   ##
==========================================
- Coverage   76.05%   76.03%   -0.03%     
==========================================
  Files         470      475       +5     
  Lines       73051    74211    +1160     
==========================================
+ Hits        55562    56424     +862     
- Misses      14045    14260     +215     
- Partials     3444     3527      +83     
Flag Coverage Δ
unittests 76.03% <83.20%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Tema

Tema commented Apr 28, 2025

Copy link
Copy Markdown
Contributor

@rleungx could you please share more background about this change?

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@ti-chi-bot ti-chi-bot Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 29, 2025
@mittalrishabh

Copy link
Copy Markdown
Member

@rleungx we also have few ideas on how to handle hot regions especially in stale reads/follower reads environment. We should collaborate on this feature.

@rleungx

rleungx commented Apr 29, 2025

Copy link
Copy Markdown
Member Author

@Tema @mittalrishabh We are going to resolve #8949. This PR is just a draft now and is used for internal testing.

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@ti-chi-bot

ti-chi-bot Bot commented May 26, 2025

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign disksing for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@rleungx rleungx force-pushed the evict-leader-hot branch from 96b04f3 to 7a7be4f Compare May 26, 2025 10:24
rleungx added 2 commits May 26, 2025 18:42
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
@ti-chi-bot

ti-chi-bot Bot commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

@rleungx: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-unit-test-next-gen-2 594b292 link true /test pull-unit-test-next-gen-2
pull-unit-test-next-gen-3 594b292 link true /test pull-unit-test-next-gen-3
pull-unit-test-next-gen-1 594b292 link true /test pull-unit-test-next-gen-1

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

rleungx added 2 commits June 25, 2026 15:53
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3ddff708-f841-4e30-942e-51d2b9adffb4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

rleungx added 2 commits June 25, 2026 16:29
…-fix

Signed-off-by: Ryan Leung <rleungx@gmail.com>

# Conflicts:
#	pkg/schedule/coordinator.go
#	pkg/schedule/filter/status.go
#	pkg/schedule/plan/status.go
#	pkg/schedule/schedulers/evict_leader.go
#	pkg/schedule/schedulers/evict_leader_test.go
#	pkg/schedule/schedulers/evict_slow_store.go
#	pkg/schedule/schedulers/evict_slow_store_test.go
#	pkg/schedule/schedulers/evict_slow_trend.go
#	pkg/statistics/collector.go
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider evict leader according to the region's flow

3 participants