-
Notifications
You must be signed in to change notification settings - Fork 721
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
schedule: revise region_scatter distribution for multi groups #3422
Conversation
Signed-off-by: Song Gao <[email protected]>
Signed-off-by: Song Gao <[email protected]>
Signed-off-by: Song Gao <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #3422 +/- ##
==========================================
- Coverage 74.75% 74.57% -0.19%
==========================================
Files 245 245
Lines 24107 24136 +29
==========================================
- Hits 18022 17999 -23
- Misses 4480 4516 +36
- Partials 1605 1621 +16
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: Song Gao <[email protected]>
Signed-off-by: Song Gao <[email protected]>
What might become worse if there is concurrency? I remember that there was a situation where there was a concurrent split of different tables. |
server/schedule/region_scatterer.go
Outdated
targetPeers[peer.GetStoreId()] = peer | ||
continue | ||
storeCount := context.selectedPeer.storeTotalCount(peer.GetStoreId()) | ||
if storeCount < maxStoreTotalCount || storeCount == minStoreTotalCount { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between storeCount < maxStoreTotalCount
and storeCount == minStoreTotalCount
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the storeCounts are all the same( maxStoreTotalCount == minStoreTotalCount), we can pick this store as candidate.
Signed-off-by: Song Gao <[email protected]>
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
@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. |
This pull request has been accepted and is ready to merge. Commit hash: e91faed
|
@Yisaer: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests 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. |
Merge canceled because a new commit is pushed. |
Signed-off-by: yisaer <[email protected]>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-4.0 in PR #3620 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.0 in PR #3621 |
…#3620) * cherry pick #3422 to release-4.0 Signed-off-by: ti-srebot <[email protected]> * fix conflict Signed-off-by: yisaer <[email protected]> * remove test Signed-off-by: yisaer <[email protected]> * remove test Signed-off-by: yisaer <[email protected]> Co-authored-by: Song Gao <[email protected]>
…#3621) Signed-off-by: ti-srebot <[email protected]> Co-authored-by: Song Gao <[email protected]> Co-authored-by: Ti Chi Robot <[email protected]>
close #6962 In past, PD conside peer distribution in the different group influenece by using `TotalCountByStore` , but not include the leader distribution. The max used situation is partition table. After this pr, TIDB call scatter api will use same group not different. ref: #3422 pingcap/tidb#46156 Signed-off-by: bufferflies <[email protected]> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
close #6962 In past, PD conside peer distribution in the different group influenece by using `TotalCountByStore` , but not include the leader distribution. The max used situation is partition table. After this pr, TIDB call scatter api will use same group not different. ref: #3422 pingcap/tidb#46156 Signed-off-by: ti-chi-bot <[email protected]> Signed-off-by: bufferflies <[email protected]> Co-authored-by: buffer <[email protected]> Co-authored-by: bufferflies <[email protected]> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
close #6962 In past, PD conside peer distribution in the different group influenece by using `TotalCountByStore` , but not include the leader distribution. The max used situation is partition table. After this pr, TIDB call scatter api will use same group not different. ref: #3422 pingcap/tidb#46156 Signed-off-by: ti-chi-bot <[email protected]> Signed-off-by: bufferflies <[email protected]> Co-authored-by: buffer <[email protected]> Co-authored-by: bufferflies <[email protected]> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
close #6962 In past, PD conside peer distribution in the different group influenece by using `TotalCountByStore` , but not include the leader distribution. The max used situation is partition table. After this pr, TIDB call scatter api will use same group not different. ref: #3422 pingcap/tidb#46156 Signed-off-by: ti-chi-bot <[email protected]> Signed-off-by: bufferflies <[email protected]> Co-authored-by: buffer <[email protected]> Co-authored-by: bufferflies <[email protected]> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Signed-off-by: Song Gao [email protected]
What problem does this PR solve?
ref pingcap/tidb#22788
Currently region-scatter didn't work well for multi regions in different groups.
For example, there are 50 regions and 6 stores in the cluster. Each region belong to a dedicated group.
region scatter may locate them in the
store1/store2/store3
. Thus from each region in the group, the distribution is well. And for the whole cluster, the distribution is not well.What is changed and how it works?
During region scatter, we should consider whether the target store already have the most peer or leader, if it is, we should skip it.
Check List
Tests
I also tested with the testcases in this document: https://docs.google.com/document/d/1cGZU2DCm0UuIueqAQP8TGqTivyavCvB_QiwIzqvP_rA/edit
All the test case results didn't change.
Release note