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

server/schedule/labeler: support schedule-disabled for region #4649

Merged
merged 9 commits into from
Mar 1, 2022

Conversation

AndreMouche
Copy link
Member

@AndreMouche AndreMouche commented Feb 17, 2022

Signed-off-by: shirly AndreMouche@126.com

What problem does this PR solve?

This PR is going to support disabling schedule for the region.

What is changed and how it work?

From TiDB(SQL)
image

with the above labels, the regions for the table would stop schedule except operators generated by join state checker. However, we can still create operators manually by pd-ctl(admin)
It works with region-label, for example:

{
 ID: "rule1", 
 Labels: []RegionLabel{
        {Key: "schedule", Value: "disabled"}
    },
 RuleType: "key-range",
 Data: makeKeyRanges("1234", "5678")
}

Check List

Tests

  • - Unit test
  • - Manual test (add detailed scripts or steps below)

Release note

region-labels: support disable schedule by region.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 17, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • disksing
  • nolouch

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 Feb 17, 2022
@AndreMouche AndreMouche force-pushed the label/schedule-disabled branch from 1c296e2 to ae569f6 Compare February 17, 2022 08:26
Signed-off-by: shirly <AndreMouche@126.com>
@AndreMouche AndreMouche force-pushed the label/schedule-disabled branch from ae569f6 to d279c3a Compare February 17, 2022 09:26
@codecov
Copy link

codecov bot commented Feb 17, 2022

Codecov Report

Merging #4649 (bd6ce2e) into master (a4b1968) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head bd6ce2e differs from pull request most recent head 857c864. Consider uploading reports for the commit 857c864 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4649      +/-   ##
==========================================
- Coverage   74.99%   74.98%   -0.02%     
==========================================
  Files         282      282              
  Lines       27776    27791      +15     
==========================================
+ Hits        20831    20839       +8     
- Misses       5083     5088       +5     
- Partials     1862     1864       +2     
Flag Coverage Δ
unittests 74.98% <100.00%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
server/schedule/operator/create_operator.go 90.44% <ø> (ø)
server/schedule/checker/checker_controller.go 77.50% <100.00%> (+1.18%) ⬆️
server/schedule/checker/joint_state_checker.go 57.89% <100.00%> (ø)
server/schedule/labeler/labeler.go 79.72% <100.00%> (+0.27%) ⬆️
server/schedule/operator/operator.go 94.81% <100.00%> (+0.03%) ⬆️
server/schedule/operator_controller.go 85.68% <100.00%> (+1.46%) ⬆️
server/schedulers/shuffle_hot_region.go 55.55% <0.00%> (-10.11%) ⬇️
server/tso/local_allocator.go 71.62% <0.00%> (-6.76%) ⬇️
server/member/member.go 63.10% <0.00%> (-5.35%) ⬇️
server/storage/hot_region_storage.go 78.73% <0.00%> (-3.45%) ⬇️
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4b1968...857c864. Read the comment docs.

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.

will schedulers still work on the range? such as balance-region-scheduler

Signed-off-by: shirly <AndreMouche@126.com>
@AndreMouche
Copy link
Member Author

will schedulers still work on the range? such as balance-region-scheduler

yes

server/schedule/operator_controller.go Outdated Show resolved Hide resolved
server/schedule/operator_controller.go Outdated Show resolved Hide resolved
Signed-off-by: shirly <AndreMouche@126.com>
Signed-off-by: shirly <AndreMouche@126.com>
Signed-off-by: shirly <AndreMouche@126.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 28, 2022
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.

LGTM

l := cl.GetRegionLabeler()
if l.ScheduleDisabled(region) {
log.Debug("schedule disabled", zap.Uint64("region-id", op.RegionID()))
operatorWaitCounter.WithLabelValues(op.Desc(), "schedule-disabled").Inc()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we missing these metrics in Grafana. need to update the template in another PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Feb 28, 2022
Signed-off-by: shirly <AndreMouche@126.com>
Signed-off-by: shirly <AndreMouche@126.com>
@rleungx
Copy link
Member

rleungx commented Mar 1, 2022

/merge

@ti-chi-bot
Copy link
Member

@rleungx: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: bd6ce2e

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 1, 2022
@ti-chi-bot
Copy link
Member

[FORMAT CHECKER NOTIFICATION]

Notice: Please provide the linked issue number on one line in the PR body, for example: Issue Number: close #123 or Issue Number: ref #456, multiple issues should use full syntax for each issue and be separated by a comma, like: Issue Number: close #123, ref #456.

📖 For more info, you can check the "Linking issues" section in the CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants