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

schedule: revise region_scatter distribution for multi groups (#3422) #3621

Merged
merged 2 commits into from
May 28, 2021

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Apr 21, 2021

cherry-pick #3422 to release-5.0
You can switch your code base to this Pull Request by using git-extras:

# In pd repo:
git pr https://github.com/tikv/pd/pull/3621

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/pd.git pr/3621:release-5.0-9e60f4d367e3

Signed-off-by: Song Gao disxiaofei@163.com

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

  • Unit test

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

  • No release note

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot ti-srebot added component/cluster Cluster logic. status/LGT2 Indicates that a PR has LGTM 2. type/cherry-pick labels Apr 21, 2021
@ti-chi-bot ti-chi-bot removed the status/LGT2 Indicates that a PR has LGTM 2. label Apr 21, 2021
@ti-srebot ti-srebot added this to the v5.0.1 milestone Apr 21, 2021
@ti-srebot
Copy link
Contributor Author

@Yisaer you're already a collaborator in bot's repo.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 21, 2021
@HunDunDM HunDunDM modified the milestones: v5.0.1, v5.0.2 Apr 25, 2021
@rleungx rleungx added type/cherry-pick-for-release-5.0 The PR belongs to release-5.0 cherry pick. and removed type/cherry-pick-for-release-1.0 labels Apr 25, 2021
@zhouqiang-cl zhouqiang-cl added the cherry-pick-approved Cherry pick PR approved by release team. label May 26, 2021
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lhy1024
  • nolouch

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 writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@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 May 28, 2021
@nolouch
Copy link
Contributor

nolouch commented May 28, 2021

/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: 1ff15bc

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 28, 2021
@codecov
Copy link

codecov bot commented May 28, 2021

Codecov Report

Merging #3621 (71218b8) into release-5.0 (04ed1ff) will decrease coverage by 0.06%.
The diff coverage is 94.28%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release-5.0    #3621      +/-   ##
===============================================
- Coverage        74.65%   74.58%   -0.07%     
===============================================
  Files              245      245              
  Lines            24149    24178      +29     
===============================================
+ Hits             18028    18034       +6     
- Misses            4509     4523      +14     
- Partials          1612     1621       +9     
Flag Coverage Δ
unittests 74.58% <94.28%> (-0.07%) ⬇️

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

Impacted Files Coverage Δ
server/schedule/operator/builder.go 87.98% <ø> (ø)
server/schedule/region_scatterer.go 88.37% <92.85%> (+1.32%) ⬆️
pkg/cache/ttl.go 97.77% <100.00%> (+0.15%) ⬆️
server/schedule/operator/create_operator.go 89.76% <100.00%> (+0.08%) ⬆️
server/region_syncer/server.go 83.33% <0.00%> (-6.07%) ⬇️
server/member/member.go 65.21% <0.00%> (-4.90%) ⬇️
server/election/leadership.go 83.52% <0.00%> (-2.36%) ⬇️
client/base_client.go 83.78% <0.00%> (-1.63%) ⬇️
server/tso/tso.go 72.39% <0.00%> (-1.23%) ⬇️
server/grpc_service.go 46.60% <0.00%> (-0.80%) ⬇️
... and 10 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 04ed1ff...71218b8. Read the comment docs.

@ti-chi-bot ti-chi-bot merged commit 77183d5 into tikv:release-5.0 May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. component/cluster Cluster logic. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/cherry-pick-for-release-5.0 The PR belongs to release-5.0 cherry pick.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants