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

schedulers: add balance witness scheduler #5763

Merged
merged 9 commits into from Dec 30, 2022

Conversation

ethercflow
Copy link
Member

close #5762

Signed-off-by: Wenbo Zhang ethercflow@gmail.com

What problem does this PR solve?

Issue Number: Close #5762

What is changed and how does it work?

schedulers: add balance witness scheduler

Check List

Tests

  • Integration test

Code changes

  • Has configuration change
  • Has HTTP API interfaces changed
  • Has persistent data change

Side effects

  • Increased code complexity

Related changes

Release note

schedulers: add balance witness scheduler

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 7, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Connor1996
  • 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 The PR should write the release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Dec 7, 2022
@ethercflow ethercflow marked this pull request as ready for review December 7, 2022 11:50
@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 Dec 7, 2022
@lhy1024
Copy link
Contributor

lhy1024 commented Dec 8, 2022

ci failed

server/schedulers/balance_witness_test.go Outdated Show resolved Hide resolved
server/schedulers/balance_witness.go Show resolved Hide resolved
server/schedulers/utils.go Outdated Show resolved Hide resolved
server/core/region_tree.go Outdated Show resolved Hide resolved
server/schedule/filter/counter.go Outdated Show resolved Hide resolved
server/schedulers/utils.go Outdated Show resolved Hide resolved
server/schedule/operator/step.go 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 Dec 9, 2022
@ti-chi-bot
Copy link
Member

@ethercflow: PR needs rebase.

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 kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 9, 2022
@codecov
Copy link

codecov bot commented Dec 9, 2022

Codecov Report

Base: 75.47% // Head: 75.55% // Increases project coverage by +0.07% 🎉

Coverage data is based on head (8b9b751) compared to base (218e8cb).
Patch coverage: 72.30% of modified lines in pull request are covered.

❗ Current head 8b9b751 differs from pull request most recent head 79613a3. Consider uploading reports for the commit 79613a3 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5763      +/-   ##
==========================================
+ Coverage   75.47%   75.55%   +0.07%     
==========================================
  Files         337      338       +1     
  Lines       33262    33580     +318     
==========================================
+ Hits        25106    25372     +266     
- Misses       5980     6024      +44     
- Partials     2176     2184       +8     
Flag Coverage Δ
unittests 75.55% <72.30%> (+0.07%) ⬆️

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

Impacted Files Coverage Δ
server/api/scheduler.go 41.11% <0.00%> (-0.86%) ⬇️
server/core/kind.go 59.09% <0.00%> (-2.82%) ⬇️
server/handler.go 52.98% <0.00%> (-0.11%) ⬇️
server/schedule/filter/counter.go 87.50% <ø> (ø)
server/schedule/operator/kind.go 100.00% <ø> (ø)
server/cluster/cluster.go 81.40% <50.00%> (-0.06%) ⬇️
server/schedule/filter/filters.go 87.95% <64.51%> (-2.23%) ⬇️
server/schedulers/balance_witness.go 65.94% <65.94%> (ø)
server/schedule/operator/step.go 76.99% <69.23%> (+3.89%) ⬆️
server/core/region.go 89.66% <77.27%> (-0.38%) ⬇️
... and 42 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ethercflow ethercflow requested review from rleungx and removed request for lhy1024 December 9, 2022 11:14
server/core/region.go Show resolved Hide resolved
server/schedulers/balance_witness.go Outdated Show resolved Hide resolved
Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 13, 2022
@bufferflies
Copy link
Contributor

maybe, you can devide the big pr into some small pr such as pd-ctl , http , scheduler .

close tikv#5762

Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
ref tikv#5762

Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
ref tikv#5762

Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
ref tikv#5762

Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
ref tikv#5762

Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
@ethercflow
Copy link
Member Author

maybe, you can devide the big pr into some small pr such as pd-ctl , http , scheduler .

Got it, thanks!

ref tikv#5762

Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
ref tikv#5762

Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
ref tikv#5762

Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
@ethercflow
Copy link
Member Author

/test build

@wuhuizuo
Copy link
Contributor

/retest

1 similar comment
@wuhuizuo
Copy link
Contributor

/retest

@@ -191,21 +189,21 @@ func (s *balanceRegionScheduler) Schedule(cluster schedule.Cluster, dryRun bool)
// Priority pick the region that has a pending peer.
// Pending region may mean the disk is overload, remove the pending region firstly.
solver.region = filter.SelectOneRegion(cluster.RandPendingRegions(solver.SourceStoreID(), s.conf.Ranges), collector,
baseRegionFilters...)
append(baseRegionFilters, filter.NewRegionWitnessFilter(solver.SourceStoreID()))...)
Copy link
Contributor

Choose a reason for hiding this comment

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

how about add NewRegionWitnessFilter to base region filters ?

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 don't think it can, because solver.SourceStoreID() needs to be passed as a parameter, and the solver is obtained by traversing sourceStores.

Copy link
Member

@rleungx rleungx left a comment

Choose a reason for hiding this comment

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

Mostly, 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 Dec 29, 2022
@nolouch
Copy link
Contributor

nolouch commented Dec 30, 2022

/merge

@ti-chi-bot
Copy link
Member

@nolouch: 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: 8b9b751

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

@ethercflow: Your PR was out of date, I have automatically updated it for you.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-chi-bot merged commit 5a4ccbe into tikv:master Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note The PR should write the 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.

add balance witness scheduler
8 participants