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: refactor hot region scheduler #4488

Merged
merged 9 commits into from
Feb 23, 2022

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Dec 22, 2021

What problem does this PR solve?

Ref #4477. This PR can be reviewed once #4424 is merged.

What is changed and how it works?

This PR does the following changes:

  • remove xxxPriorityIsBetter
  • move clearPendingInfluence to test package
  • simplify and rename variables

Check List

Tests

  • Unit test

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 22, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • bufferflies
  • lhy1024

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 Dec 22, 2021
@rleungx rleungx requested a review from nolouch December 22, 2021 06:48
@codecov
Copy link

codecov bot commented Dec 22, 2021

Codecov Report

Merging #4488 (3f2d180) into master (8328528) will decrease coverage by 0.04%.
The diff coverage is 92.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4488      +/-   ##
==========================================
- Coverage   74.60%   74.56%   -0.05%     
==========================================
  Files         287      287              
  Lines       27973    27946      -27     
==========================================
- Hits        20869    20837      -32     
- Misses       5219     5223       +4     
- Partials     1885     1886       +1     
Flag Coverage Δ
unittests 74.56% <92.45%> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
server/schedulers/hot_region.go 83.08% <90.24%> (+0.20%) ⬆️
server/schedulers/grant_hot_region.go 58.54% <100.00%> (ø)
server/statistics/collector.go 93.75% <100.00%> (ø)
server/statistics/store_hot_peers_infos.go 100.00% <100.00%> (ø)
server/statistics/store_load.go 95.76% <100.00%> (ø)
pkg/tempurl/tempurl.go 45.00% <0.00%> (-15.00%) ⬇️
server/storage/kv/etcd_kv.go 69.56% <0.00%> (-10.15%) ⬇️
server/region_syncer/server.go 81.45% <0.00%> (-3.98%) ⬇️
server/tso/allocator_manager.go 62.74% <0.00%> (-3.04%) ⬇️
server/tso/tso.go 63.06% <0.00%> (-1.71%) ⬇️
... and 13 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 8328528...3f2d180. Read the comment docs.

@lhy1024
Copy link
Contributor

lhy1024 commented Dec 22, 2021

Would you like to add more descriptions?

@rleungx
Copy link
Member Author

rleungx commented Dec 22, 2021

Would you like to add more descriptions?

You can take a look at the PR description, this draft will be ready to review once #4424 is merged.

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 15, 2022
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 20, 2022
@rleungx rleungx marked this pull request as ready for review January 20, 2022 09:33
@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 Jan 20, 2022
@rleungx rleungx added the component/scheduler Scheduler logic. label Jan 20, 2022
@rleungx rleungx removed the request for review from Yisaer January 20, 2022 09:34
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 21, 2022
@@ -158,6 +153,11 @@ func (s *StoreSummaryInfo) AddInfluence(infl *Influence, w float64) {
s.PendingSum.Count += infl.Count * w
}

// IsTiFlash returns if the store is TiFlash.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// IsTiFlash returns if the store is TiFlash.
// IsTiFlash returns true if the store is TiFlash.

Copy link
Contributor

@bufferflies bufferflies left a comment

Choose a reason for hiding this comment

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

rest LGTM

@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 23, 2022
ref tikv#3879

Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
@rleungx
Copy link
Member Author

rleungx commented Feb 23, 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: 3f2d180

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 23, 2022
@ti-chi-bot ti-chi-bot merged commit 3c5e7a7 into tikv:master Feb 23, 2022
@rleungx rleungx deleted the refactor-hot-scheduler branch February 23, 2022 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/scheduler Scheduler logic. 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.

4 participants