-
Notifications
You must be signed in to change notification settings - Fork 720
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
rule_checker: can replace unhealthPeer with orphanPeer #6831
Conversation
Signed-off-by: nolouch <[email protected]>
[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 submitting an approval review. |
Signed-off-by: nolouch <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #6831 +/- ##
==========================================
+ Coverage 74.21% 74.26% +0.04%
==========================================
Files 414 414
Lines 43471 43511 +40
==========================================
+ Hits 32264 32313 +49
+ Misses 8338 8319 -19
- Partials 2869 2879 +10
Flags with carried forward coverage won't be shown. Click here to find out more. |
PTAL @rleungx @CabinfeverB |
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.
Rest LGTM
Signed-off-by: nolouch <[email protected]>
Signed-off-by: nolouch <[email protected]>
pkg/schedule/checker/rule_checker.go
Outdated
continue | ||
} | ||
// store should be down. | ||
if !c.isStoreDownTimeHitMaxDownTime(pinDownPeer.GetPeer().GetStoreId()) { |
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.
do nothing if the store-id is not exist.
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.
It will return false
when calling isStoreDownTimeHitMaxDownTime
.
pkg/schedule/checker/rule_checker.go
Outdated
// check if down peer can replace with orphan peer. | ||
|
||
dstStore := c.cluster.GetStore(orphanPeer.GetStoreId()) | ||
if fit.Replace(pinDownPeer.GetPeer().GetStoreId(), dstStore) { |
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.
waht it will do if the orphan peer is also down peer?
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.
we will skip in the before.
Signed-off-by: nolouch <[email protected]>
pkg/schedule/checker/rule_checker.go
Outdated
// check if down peer can replace with orphan peer. | ||
dstStore := c.cluster.GetStore(orphanPeer.GetStoreId()) | ||
if fit.Replace(pinDownPeer.GetPeer().GetStoreId(), dstStore) { | ||
destRole := pinDownPeer.GetPeer().Role |
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.
How about using a variable for pinDownPeer.GetPeer()
and using GetRole
here?
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.
The rest LGTM
Signed-off-by: nolouch <[email protected]>
404a7b1
to
d7c092d
Compare
Signed-off-by: nolouch <[email protected]>
/merge |
@nolouch: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
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: b72fbea
|
@nolouch: Your PR was out of date, I have automatically updated it for you. 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. |
In response to a cherrypick label: new pull request created to branch |
close tikv#6559 Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
close tikv#6559 Signed-off-by: ti-chi-bot <[email protected]>
close #6559 add logic try to replace unhealthy peer with orphan peer Signed-off-by: ti-chi-bot <[email protected]> Signed-off-by: nolouch <[email protected]> Co-authored-by: ShuNing <[email protected]> Co-authored-by: nolouch <[email protected]>
close #6559 add logic try to replace unhealthy peer with orphan peer Signed-off-by: ti-chi-bot <[email protected]> Signed-off-by: nolouch <[email protected]> Co-authored-by: ShuNing <[email protected]> Co-authored-by: nolouch <[email protected]>
close tikv#6559 add logic try to replace unhealthy peer with orphan peer Signed-off-by: nolouch <[email protected]> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
What problem does this PR solve?
Issue Number: Close #6559
When Region looks like the below, and there were only 4 stores:
and the region fit likes:
cannot fix the region, always report as an unhealthy region. and store 4 is gone.
What is changed and how does it work?
Check List
Tests
Release note