Skip to content

region_scatterer: fix the bug that could generate schedule with too few peers (#4570)#4581

Merged
ti-chi-bot merged 1 commit intotikv:release-5.4from
ti-chi-bot:cherry-pick-4570-to-release-5.4
Jan 14, 2022
Merged

region_scatterer: fix the bug that could generate schedule with too few peers (#4570)#4581
ti-chi-bot merged 1 commit intotikv:release-5.4from
ti-chi-bot:cherry-pick-4570-to-release-5.4

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

This is an automated cherry-pick of #4570

What problem does this PR solve?

close #4565

What is changed and how it works?

If an originPeer is already in selectStore, continue directly. Otherwise, it will end up picking a targetPeer which is either itself or some other store that is not in the initial peer list. Since entering the select phase, it is guaranteed that it is not in the selectStore, so it is always guaranteed that the worst-case selection itself is feasible at this time. In the end, the number of peers before and after can be guaranteed to remain unchanged.

Check List

Tests

  • Unit test

When not modified, the following operator may be generated:

scatter-region {rm peer: store [3]} (kind:region,leader, region:201(0,0), createAt:2022-01-13 18:24:32.375399 +0800 CST m=+0.014571751, startAt:0001-01-01 00:00:00 +0000 UTC, currentStep:0, steps:[transfer leader from store 3 to store 4, remove peer on store 3])

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 few peers.

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

ti-chi-bot commented Jan 14, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • HunDunDM
  • 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.

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 do-not-merge/cherry-pick-not-approved release-note Denotes a PR that will be considered when it comes time to generate release notes. component/schedule Scheduling logic. type/bugfix This PR fixes a bug. type/cherry-pick-for-release-5.4 This PR is cherry-picked to release-5.4 from a source PR. labels Jan 14, 2022
@zhouqiang-cl zhouqiang-cl added the cherry-pick-approved Cherry pick PR approved by release team. label Jan 14, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 14, 2022
@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 Jan 14, 2022
@nolouch nolouch force-pushed the cherry-pick-4570-to-release-5.4 branch 3 times, most recently from 857c2ff to d307843 Compare January 14, 2022 08:43
…ew peers (tikv#4570)

Signed-off-by: HunDunDM <hundundm@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>
@nolouch nolouch force-pushed the cherry-pick-4570-to-release-5.4 branch from d307843 to 05c49e0 Compare January 14, 2022 08:44
@nolouch
Copy link
Copy Markdown
Contributor

nolouch commented Jan 14, 2022

/merge

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

@nolouch: 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: 05c49e0

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 14, 2022
@nolouch
Copy link
Copy Markdown
Contributor

nolouch commented Jan 14, 2022

/run-all-tests

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 14, 2022

Codecov Report

Merging #4581 (05c49e0) into release-5.4 (9413840) will decrease coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release-5.4    #4581      +/-   ##
===============================================
- Coverage        74.77%   74.68%   -0.09%     
===============================================
  Files              265      265              
  Lines            27959    27963       +4     
===============================================
- Hits             20905    20885      -20     
- Misses            5193     5213      +20     
- Partials          1861     1865       +4     
Flag Coverage Δ
unittests 74.68% <100.00%> (-0.09%) ⬇️

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

Impacted Files Coverage Δ
server/schedule/region_scatterer.go 78.99% <100.00%> (-3.92%) ⬇️
pkg/errs/errs.go 75.00% <0.00%> (-25.00%) ⬇️
server/tso/local_allocator.go 64.86% <0.00%> (-6.76%) ⬇️
server/statistics/hot_cache_task.go 81.81% <0.00%> (-4.55%) ⬇️
server/schedulers/random_merge.go 60.00% <0.00%> (-3.34%) ⬇️
server/region_syncer/client.go 83.59% <0.00%> (-1.57%) ⬇️
server/schedule/operator_controller.go 83.02% <0.00%> (-1.23%) ⬇️
server/tso/allocator_manager.go 64.72% <0.00%> (-1.00%) ⬇️
pkg/btree/btree.go 85.78% <0.00%> (-0.97%) ⬇️
... and 14 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 9413840...05c49e0. Read the comment docs.

@ti-chi-bot ti-chi-bot merged commit b71905d into tikv:release-5.4 Jan 14, 2022
@ti-chi-bot ti-chi-bot deleted the cherry-pick-4570-to-release-5.4 branch April 15, 2025 07:54
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/schedule Scheduling logic. 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. type/cherry-pick-for-release-5.4 This PR is cherry-picked to release-5.4 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants