Skip to content

region_scatter: fix a bug that the leaders may be unbalanced after scatter region (#6054)#6060

Merged
ti-chi-bot merged 5 commits intotikv:release-6.1from
ti-chi-bot:cherry-pick-6054-to-release-6.1
Mar 27, 2023
Merged

region_scatter: fix a bug that the leaders may be unbalanced after scatter region (#6054)#6060
ti-chi-bot merged 5 commits intotikv:release-6.1from
ti-chi-bot:cherry-pick-6054-to-release-6.1

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

This is an automated cherry-pick of #6054

What problem does this PR solve?

Issue Number: Close #6017

What is changed and how does it work?

Use a more correct method to select candidate leaders.

Check List

Tests

  • Unit test

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

Release note

Fix a bug that the leaders may be unbalanced during scatter region.

close tikv#6017

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Copy Markdown
Member Author

ti-chi-bot commented Feb 28, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • bufferflies
  • lhy1024

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.

Details

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 Denotes a PR that will be considered when it comes time to generate release notes. type/cherry-pick-for-release-6.1 This PR is cherry-picked to release-6.1 from a source PR. do-not-merge/cherry-pick-not-approved labels Feb 28, 2023
@CabinfeverB
Copy link
Copy Markdown
Member

should merge #6128

@CabinfeverB CabinfeverB assigned CabinfeverB and unassigned HunDunDM Mar 27, 2023
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
@CabinfeverB CabinfeverB force-pushed the cherry-pick-6054-to-release-6.1 branch from d69ae0a to 0f57c1b Compare March 27, 2023 11:19
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 27, 2023
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 27, 2023
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 27, 2023
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2023

Codecov Report

Patch coverage: 84.21% and project coverage change: -0.02 ⚠️

Comparison is base (0646a37) 75.44% compared to head (a8fed33) 75.43%.

❗ Current head a8fed33 differs from pull request most recent head d271751. Consider uploading reports for the commit d271751 to get more accurate results

Additional details and impacted files
@@               Coverage Diff               @@
##           release-6.1    #6060      +/-   ##
===============================================
- Coverage        75.44%   75.43%   -0.02%     
===============================================
  Files              307      307              
  Lines            30481    30491      +10     
===============================================
+ Hits             22997    23000       +3     
- Misses            5486     5489       +3     
- Partials          1998     2002       +4     
Flag Coverage Δ
unittests 75.43% <84.21%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
server/schedule/region_scatterer.go 83.07% <84.21%> (+0.27%) ⬆️

... and 21 files with indirect coverage changes

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
}

func allowLeader(fit *placement.RegionFit, peer *metapb.Peer) bool {
switch peer.GetRole() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe skip pending peer.

@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 Mar 27, 2023
@VelocityLight VelocityLight added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Mar 27, 2023
@CabinfeverB
Copy link
Copy Markdown
Member

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member Author

@CabinfeverB: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

Details

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
Copy Markdown
Member Author

This pull request has been accepted and is ready to merge.

DetailsCommit hash: d271751

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 27, 2023
@ti-chi-bot ti-chi-bot merged commit 39a4de6 into tikv:release-6.1 Mar 27, 2023
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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-6.1 This PR is cherry-picked to release-6.1 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants