Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduler: speed up exit #5341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

han-ian
Copy link

@han-ian han-ian commented Jul 21, 2022

What problem does this PR solve?

Issue Number: Close #5274

What is changed and how does it work?

     if coordinator's ctx has been closed, don't do more schedule. 

Check List

Tests

  • Manual test (add detailed scripts or steps below)
    For our cluster with more than 2000 tikv-servers, pd transfer leader can be done in 1 second.

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

Release note

speed up scheduler exit  

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jul 21, 2022
@ti-chi-bot ti-chi-bot requested review from lhy1024 and rleungx July 21, 2022 10:28
@han-ian han-ian force-pushed the coordinator_exit_speed_up branch 3 times, most recently from c2a4fd6 to fa8db5b Compare July 21, 2022 11:07
Signed-off-by: yin.han <[email protected]>
@han-ian han-ian force-pushed the coordinator_exit_speed_up branch from fa8db5b to 5f63dfe Compare July 21, 2022 11:12
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for you contribution.

@@ -364,6 +364,11 @@ func (l *balanceLeaderScheduler) Schedule(cluster schedule.Cluster, dryRun bool)

result := make([]*operator.Operator, 0, batch)
for sourceCandidate.hasStore() || targetCandidate.hasStore() {
// if coordinator is stopping, speed up exit.
if l.BaseScheduler.OpController.Ctx().Err() != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can consider adding the context field for all schedulers?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every scheduler have a BaseScheduler, and BaseScheduler have opController with a context filed, I think it's no difference.

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 24, 2022
@ti-chi-bot
Copy link
Member

@in-han: PR needs rebase.

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coordinator can't stop in time, because of background jobs are still running
3 participants