-
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cf1d5ac
rule_checker: can replace unhealthPeer with orphanPeer
nolouch b3e3e00
Merge branch 'master' into fix-unhealthy-repair
nolouch eb8251f
fix test
nolouch ee4b85e
Merge remote-tracking branch 'nolouch/fix-unhealthy-repair' into fix-…
nolouch 4ab99b1
address
nolouch bbbeea7
address
nolouch 65aa679
address
nolouch d7c092d
address
nolouch b72fbea
address
nolouch a148eda
Merge branch 'master' into fix-unhealthy-repair
ti-chi-bot[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix test
Signed-off-by: nolouch <nolouch@gmail.com>
- Loading branch information
commit eb8251fe11d659224089157deb0822856a889c71
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -480,11 +480,12 @@ loopFits: | |
continue | ||
} | ||
// check if down peer can replace with orphan peer. | ||
ruleCheckerReplaceOrphanPeerCounter.Inc() | ||
|
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. How about using a variable for |
||
orphanPeerRole := orphanPeer.GetRole() | ||
ruleCheckerReplaceOrphanPeerCounter.Inc() | ||
switch { | ||
case orphanPeerRole == metapb.PeerRole_Learner && destRole == metapb.PeerRole_Voter: | ||
return operator.CreatePromoteLearnerOperatorAndRemovePeer("replace-down-peer-with-orphan-peer", c.cluster, region, orphanPeer, pinDownPeer.GetPeer()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.