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: support range for schedulers #1791

Merged
merged 7 commits into from Nov 6, 2019
Merged

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Oct 10, 2019

What problem does this PR solve?

Currently, the schedulers don't support the key range. e.g. Given a key range, the scheduler only works in this range. And thus to make the scheduler more flexible, we need to support range for schedulers.

What is changed and how it works?

This PR supports range for schedulers. It should be reviewed after

Check List

Tests

  • Unit test

edit:

  • add more unit tests

@rleungx rleungx added the component/schedule Scheduling logic. label Oct 10, 2019
@rleungx rleungx force-pushed the range-scheduler branch 3 times, most recently from 565fbc5 to d5b0f15 Compare October 11, 2019 03:45
@nolouch nolouch added the priority/P1 The issue has P1 priority. label Oct 15, 2019
Copy link
Contributor

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

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

the rest LGTM

server/core/region.go Outdated Show resolved Hide resolved
server/schedulers/utils.go Outdated Show resolved Hide resolved
server/schedulers/utils.go Show resolved Hide resolved
@@ -43,6 +45,7 @@ func init() {
}
conf.Limit = limit
}
conf.Name = shuffleHotRegionName
Copy link
Contributor

Choose a reason for hiding this comment

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

does it need ranges just like shuffle_ragion and shuffle_leader?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if the hot region related schedulers should support the range. /cc @nolouch

server/coordinator_test.go Outdated Show resolved Hide resolved
@rleungx rleungx force-pushed the range-scheduler branch 2 times, most recently from 96bafaf to fdd9aeb Compare October 29, 2019 07:36
@rleungx
Copy link
Member Author

rleungx commented Oct 29, 2019

/run-all-tests

@rleungx rleungx force-pushed the range-scheduler branch 2 times, most recently from d133e8a to 6be19ab Compare October 30, 2019 11:23
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 Nov 4, 2019

/run-all-tests

@codecov-io
Copy link

codecov-io commented Nov 4, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@b7d614e). Click here to learn what that means.
The diff coverage is 75.86%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1791   +/-   ##
=========================================
  Coverage          ?   77.49%           
=========================================
  Files             ?      164           
  Lines             ?    16586           
  Branches          ?        0           
=========================================
  Hits              ?    12854           
  Misses            ?     2717           
  Partials          ?     1015
Impacted Files Coverage Δ
server/schedulers/scatter_range.go 82.46% <100%> (ø)
server/schedulers/adjacent_region.go 76.63% <100%> (ø)
server/schedule/range_cluster.go 91.42% <100%> (ø)
server/schedulers/shuffle_hot_region.go 54.83% <50%> (ø)
server/schedulers/grant_leader.go 84% <60%> (ø)
server/schedulers/evict_leader.go 81.03% <60%> (ø)
server/schedulers/utils.go 85.36% <71.42%> (ø)
server/core/basic_cluster.go 91.62% <71.42%> (ø)
server/core/region.go 91.47% <72.72%> (ø)
server/cluster.go 82.86% <75%> (ø)
... and 6 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 b7d614e...495aa16. Read the comment docs.

server/schedulers/balance_test.go Outdated Show resolved Hide resolved
server/schedulers/balance_test.go Outdated Show resolved Hide resolved
server/schedulers/balance_test.go Outdated Show resolved Hide resolved
server/schedulers/balance_test.go Outdated Show resolved Hide resolved
server/cluster_test.go Show resolved Hide resolved
server/core/region.go Show resolved Hide resolved
Signed-off-by: Ryan Leung <rleungx@gmail.com>
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.

rest LGTM

server/core/region.go Show resolved Hide resolved
@nolouch nolouch added the status/can-merge Indicates a PR has been approved by a committer. label Nov 6, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 6, 2019

Your auto merge job has been accepted, waiting for 1894

@sre-bot
Copy link
Contributor

sre-bot commented Nov 6, 2019

/run-all-tests

@sre-bot sre-bot merged commit cb56454 into tikv:master Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/schedule Scheduling logic. priority/P1 The issue has P1 priority. status/can-merge Indicates a PR has been approved by a committer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants