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

region_scatterer: fix the bug that could generate schedule with too many peers #5920

Merged
merged 3 commits into from
Feb 7, 2023

Conversation

HunDunDM
Copy link
Member

@HunDunDM HunDunDM commented Feb 7, 2023

What problem does this PR solve?

Issue Number: Close #5909

What is changed and how does it work?

Introduced in #4570 , used stores were not excluded resulting in possible selection of too many targeterPeers.

Check List

Tests

  • Unit test

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

Release note

Fix the bug that the region scatterer may generate the schedule with too many peers.

…any peers

Signed-off-by: HunDunDM <hundundm@gmail.com>
@HunDunDM HunDunDM added component/schedule Scheduling logic. type/bugfix This PR fixes a bug. labels Feb 7, 2023
@HunDunDM HunDunDM requested review from lhy1024 and rleungx February 7, 2023 04:38
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 7, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lhy1024
  • 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 Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/needs-triage-completed labels Feb 7, 2023
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 7, 2023
@codecov
Copy link

codecov bot commented Feb 7, 2023

Codecov Report

Base: 75.43% // Head: 75.42% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (6b78c7d) compared to base (7497e3d).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 6b78c7d differs from pull request most recent head 40521b7. Consider uploading reports for the commit 40521b7 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5920      +/-   ##
==========================================
- Coverage   75.43%   75.42%   -0.01%     
==========================================
  Files         345      345              
  Lines       35126    35127       +1     
==========================================
  Hits        26496    26496              
- Misses       6330     6334       +4     
+ Partials     2300     2297       -3     
Flag Coverage Δ
unittests 75.42% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
server/schedule/region_scatterer.go 79.13% <100.00%> (+0.08%) ⬆️
pkg/storage/endpoint/meta.go 63.63% <0.00%> (-4.55%) ⬇️
pkg/storage/kv/etcd_kv.go 72.22% <0.00%> (-3.18%) ⬇️
pkg/election/leadership.go 75.25% <0.00%> (-3.10%) ⬇️
pkg/dashboard/adapter/manager.go 79.31% <0.00%> (-2.30%) ⬇️
server/schedule/operator_controller.go 85.97% <0.00%> (-0.91%) ⬇️
server/grpc_service.go 48.70% <0.00%> (-0.65%) ⬇️
server/statistics/store_collection.go 93.75% <0.00%> (-0.63%) ⬇️
server/cluster/cluster.go 81.42% <0.00%> (-0.52%) ⬇️
server/server.go 74.14% <0.00%> (-0.38%) ⬇️
... and 10 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.

@ti-chi-bot ti-chi-bot added needs-cherry-pick-release-5.0 The PR needs to cherry pick to release-5.0 branch. needs-cherry-pick-release-5.1 Type: Need cherry pick to release-5.1 needs-cherry-pick-release-5.2 Type: Need cherry pick to release-5.2 needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. and removed do-not-merge/needs-triage-completed labels Feb 7, 2023
@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 Feb 7, 2023
@HunDunDM
Copy link
Member Author

HunDunDM commented Feb 7, 2023

/merge

@ti-chi-bot
Copy link
Member

@HunDunDM: 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: 40521b7

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 7, 2023
@ti-chi-bot ti-chi-bot merged commit f5b5391 into tikv:master Feb 7, 2023
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #5923.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-5.0: #5924.

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Feb 7, 2023
ref tikv#4570, close tikv#5909

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

In response to a cherrypick label: new pull request created to branch release-5.1: #5925.

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Feb 7, 2023
ref tikv#4570, close tikv#5909

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

In response to a cherrypick label: new pull request created to branch release-5.2: #5926.

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Feb 7, 2023
ref tikv#4570, close tikv#5909

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

In response to a cherrypick label: new pull request created to branch release-5.3: #5927.

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Feb 7, 2023
ref tikv#4570, close tikv#5909

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

In response to a cherrypick label: new pull request created to branch release-5.4: #5928.

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Feb 7, 2023
ref tikv#4570, close tikv#5909

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

In response to a cherrypick label: new pull request created to branch release-6.1: #5929.

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Feb 7, 2023
ref tikv#4570, close tikv#5909

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@HunDunDM HunDunDM deleted the fix-5909 branch February 7, 2023 10:00
ti-chi-bot added a commit that referenced this pull request Feb 13, 2023
…any peers (#5920) (#5923)

ref #4570, close #5909, ref #5920

Signed-off-by: HunDunDM <hundundm@gmail.com>

Co-authored-by: HunDunDM <hundundm@gmail.com>
ti-chi-bot added a commit that referenced this pull request Mar 27, 2023
…any peers (#5920) (#5929)

ref #4570, close #5909, ref #5920

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>

Co-authored-by: 混沌DM <hundundm@gmail.com>
Co-authored-by: Cabinfever_B <cabinfeveroier@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/schedule Scheduling logic. needs-cherry-pick-release-5.0 The PR needs to cherry pick to release-5.0 branch. needs-cherry-pick-release-5.1 Type: Need cherry pick to release-5.1 needs-cherry-pick-release-5.2 Type: Need cherry pick to release-5.2 needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. 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/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scatter region is unexpected which causes uneven region distribution
4 participants