-
Notifications
You must be signed in to change notification settings - Fork 719
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
unsafe_recovery: also consider applied index when selects force leader #7920
Conversation
[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. |
/cc @nolouch @Connor1996 PTAL |
@glorv: GitHub didn't allow me to request PR reviews from the following users: PTAL. Note that only tikv members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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 kubernetes/test-infra repository. |
Signed-off-by: glorv <[email protected]>
Need to update go mod. |
maxIdxA := typeutil.MaxUint64(a.report.GetRaftState().GetLastIndex(), a.report.AppliedIndex) | ||
maxIdxB := typeutil.MaxUint64(b.report.GetRaftState().GetLastIndex(), b.report.AppliedIndex) | ||
return int(maxIdxA - maxIdxB) | ||
}, | ||
func(a, b *regionItem) int { | ||
return int(a.report.GetRaftState().GetLastIndex()) - int(b.report.GetRaftState().GetLastIndex()) |
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 we need to compare the last index again?
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.
Yes, if max(applied_index) == max(last_index), we better choose the max(last_index) peer to avoid doing force compact.
Co-authored-by: Connor <[email protected]> Signed-off-by: glorv <[email protected]>
Signed-off-by: glorv <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #7920 +/- ##
==========================================
+ Coverage 73.49% 73.59% +0.09%
==========================================
Files 436 436
Lines 48525 48529 +4
==========================================
+ Hits 35665 35715 +50
+ Misses 9802 9757 -45
+ Partials 3058 3057 -1
Flags with carried forward coverage won't be shown. Click here to find out more. |
@Connor1996 PTAL again, thanks~ |
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.
LGTM
/merge |
@Connor1996: 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: 172ba3b
|
@glorv: 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. |
What problem does this PR solve?
Issue Number: close #7919, ref tikv/tikv#16717
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs
/pingcap/docs-cn
:pingcap/tiup
:Release note