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: set different priorities for write-leader and write-peer #3937

Merged
merged 9 commits into from
Aug 2, 2021

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Aug 2, 2021

What problem does this PR solve?

write-leader and write-peer need to have different priorities because write leader needs to have balanced metrics that reflect the leader, such as sum of key or qps, but write-peer does not, and write-peer does not necessarily have data on qps.

What is changed and how it works?

set different priorities for write-leader and write-peer

Check List

Tests

  • Unit test

Release note

None.

Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
@lhy1024 lhy1024 added the component/scheduler Scheduler logic. label Aug 2, 2021
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 2, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • HunDunDM
  • Yisaer

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-none Denotes a PR that doesn't merit a release note. label Aug 2, 2021
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
@codecov
Copy link

codecov bot commented Aug 2, 2021

Codecov Report

Merging #3937 (f52e08e) into master (1b24b4a) will decrease coverage by 0.08%.
The diff coverage is 100.00%.

❗ Current head f52e08e differs from pull request most recent head 7530e42. Consider uploading reports for the commit 7530e42 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3937      +/-   ##
==========================================
- Coverage   74.72%   74.63%   -0.09%     
==========================================
  Files         246      246              
  Lines       25068    25068              
==========================================
- Hits        18731    18709      -22     
- Misses       4685     4702      +17     
- Partials     1652     1657       +5     
Flag Coverage Δ
unittests 74.63% <100.00%> (-0.09%) ⬇️

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

Impacted Files Coverage Δ
server/schedulers/hot_region.go 85.77% <100.00%> (+0.20%) ⬆️
server/schedulers/hot_region_config.go 82.07% <100.00%> (+1.12%) ⬆️
tools/pd-ctl/pdctl/command/scheduler.go 73.43% <100.00%> (+0.24%) ⬆️
pkg/tempurl/tempurl.go 45.00% <0.00%> (-15.00%) ⬇️
server/tso/local_allocator.go 71.62% <0.00%> (-6.76%) ⬇️
server/region_syncer/client.go 77.46% <0.00%> (-4.23%) ⬇️
pkg/dashboard/adapter/manager.go 79.78% <0.00%> (-3.20%) ⬇️
server/server.go 71.58% <0.00%> (-1.22%) ⬇️
pkg/btree/btree.go 85.30% <0.00%> (-0.97%) ⬇️
server/schedule/operator_controller.go 84.75% <0.00%> (-0.80%) ⬇️
... and 8 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 1b24b4a...7530e42. Read the comment docs.

@nolouch
Copy link
Contributor

nolouch commented Aug 2, 2021

It's may conflict? especially we add qps.

Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
@lhy1024
Copy link
Contributor Author

lhy1024 commented Aug 2, 2021

It's may conflict? especially we add qps.

In fact, the write leader's priority now has key as first priority and byte as second priority, while the write peer's priority has byte as first priority and key as second priority. They are now different.

This pr doesn't change the default behaviour, it just avoids query in the write peer's scheduling priority. because the follower doesn't have this statistic.

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.

Rest LGTM

tools/pd-ctl/pdctl/command/scheduler.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added status/LGT1 Indicates that a PR has LGTM 1. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 2, 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 2, 2021
Copy link
Member

@HunDunDM HunDunDM 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

tests/pdctl/scheduler/scheduler_test.go Outdated Show resolved Hide resolved
@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 2, 2021
Signed-off-by: lhy1024 <admin@liudos.us>
@lhy1024
Copy link
Contributor Author

lhy1024 commented Aug 2, 2021

/merge

@ti-chi-bot
Copy link
Member

@lhy1024: 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: 68b184f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 2, 2021
@ti-chi-bot ti-chi-bot merged commit 386b044 into tikv:master Aug 2, 2021
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.

5 participants