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: use pending amp in hot region scheduler #3926

Merged
merged 9 commits into from
Aug 7, 2021

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Jul 30, 2021

What problem does this PR solve?

In the past, for two stores with large differences, it was easy to have redundant scheduling behavior, because as the difference between the two stores approached, the speed might not come down in time, so we limited the speed by adding pending amps, and the closer the two stores were, the fewer regions were allowed to be scheduled at the same time.

Before
image

After
image

What is changed and how it works?

isTolerance checks source store and target store by checking the difference value with pendingAmpFactor * pendingPeer. This will make the hot region scheduling slow even serialized running when each 2 store's pending influence is close.

Check List

Tests

  • Unit test

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 30, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Yisaer
  • rleungx

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 release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jul 30, 2021
@codecov
Copy link

codecov bot commented Aug 1, 2021

Codecov Report

Merging #3926 (2cc3ac5) into master (8481fab) will increase coverage by 0.03%.
The diff coverage is 97.56%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3926      +/-   ##
==========================================
+ Coverage   74.64%   74.67%   +0.03%     
==========================================
  Files         247      247              
  Lines       25372    25408      +36     
==========================================
+ Hits        18939    18974      +35     
+ Misses       4759     4757       -2     
- Partials     1674     1677       +3     
Flag Coverage Δ
unittests 74.67% <97.56%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
server/schedulers/hot_region.go 84.14% <94.11%> (+0.97%) ⬆️
pkg/mock/mockcluster/mockcluster.go 95.69% <100.00%> (-0.16%) ⬇️
server/core/region_option.go 86.00% <100.00%> (+1.55%) ⬆️
server/schedulers/hot_region_config.go 89.31% <100.00%> (+2.59%) ⬆️
server/schedulers/metrics.go 100.00% <100.00%> (ø)
server/schedulers/utils.go 95.06% <100.00%> (+0.09%) ⬆️
pkg/tempurl/tempurl.go 45.00% <0.00%> (-25.00%) ⬇️
server/schedulers/shuffle_hot_region.go 55.55% <0.00%> (-10.11%) ⬇️
server/schedulers/random_merge.go 60.00% <0.00%> (-3.34%) ⬇️
server/core/storage.go 67.68% <0.00%> (-1.53%) ⬇️
... and 17 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 8481fab...2cc3ac5. Read the comment docs.

@nolouch nolouch added the priority/P1 The issue has P1 priority. label Aug 3, 2021
Copy link
Contributor

@Yisaer Yisaer left a comment

Choose a reason for hiding this comment

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

basically lgtm

server/schedulers/hot_region.go Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 4, 2021
@ti-chi-bot ti-chi-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 4, 2021
@lhy1024 lhy1024 marked this pull request as ready for review August 4, 2021 11:38
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 4, 2021
server/schedulers/hot_region_config.go Outdated Show resolved Hide resolved
server/schedulers/hot_region.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 5, 2021
Signed-off-by: lhy1024 <admin@liudos.us>
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 5, 2021
@lhy1024
Copy link
Contributor Author

lhy1024 commented Aug 5, 2021

@rleungx PTAL

Signed-off-by: lhy1024 <admin@liudos.us>
@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 Aug 5, 2021
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
server/schedulers/utils.go Outdated Show resolved Hide resolved
server/schedulers/hot_region.go Show resolved Hide resolved
server/schedulers/hot_region.go Outdated Show resolved Hide resolved
server/schedulers/hot_region_test.go Outdated Show resolved Hide resolved
Signed-off-by: lhy1024 <admin@liudos.us>
@HunDunDM
Copy link
Member

HunDunDM commented Aug 7, 2021

/merge

@ti-chi-bot
Copy link
Member

@HunDunDM: 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: 0356cce

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 7, 2021
@ti-chi-bot ti-chi-bot merged commit 5d35e13 into tikv:master Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/P1 The issue has P1 priority. release-note-none Denotes a PR that doesn't merit a release note. 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.

7 participants