-
Notifications
You must be signed in to change notification settings - Fork 726
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: fix the issue of not being able to achieve the better RegionFit #7219
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. |
0700d50
to
e6664b8
Compare
Codecov Report
@@ Coverage Diff @@
## master #7219 +/- ##
==========================================
+ Coverage 74.35% 74.37% +0.02%
==========================================
Files 446 442 -4
Lines 48159 47908 -251
==========================================
- Hits 35810 35633 -177
+ Misses 9191 9107 -84
- Partials 3158 3168 +10
Flags with carried forward coverage won't be shown. Click here to find out more. |
a51fb5e
to
859d708
Compare
ptal @CabinfeverB @rleungx |
rules []string | ||
opStr string | ||
}{ | ||
{"111_leader,211,311", []string{"3/voter//", "3/learner/type=read/"}, "replace-rule-swap-fit-peer {mv peer: store [111] to"}, |
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.
mv peer: store [111] to
pls add target into op desc?
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.
And IMO, no need to remove the old peer, just add voter and demote old 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.
mv peer: store [111] to
pls add target into op desc?
The target is random here.
continue | ||
} | ||
ruleCheckerNoStoreThenTryReplace.Inc() | ||
op, err := c.replaceUnexpectRulePeer(region, oldPeerRuleFit, fit, p, "swap-fit") |
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.
ref https://github.com/tikv/pd/pull/7219/files#r1367687550, maybe another op?
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.
I want to reuse the old function and make it right first, it needs to be picked to 7.5. maybe improve it after this pr.
BTW, I think in most situations, there should be enough stores to add learners.
|
||
// example: "3/voter/zone=zone1+zone2,rack=rack2/zone,rack,host" | ||
// count role constraints location_labels | ||
func makeRule(def string) *placement.Rule { |
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 use this method
pd/pkg/schedule/placement/fit_test.go
Line 80 in 4b7e792
func makeRule(def string) *Rule { |
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, it's a copy of that because not in the same package, do not let the test have dependence first. maybe extract to unit package later.
} | ||
|
||
// example: "1111_leader,1234,2111_learner" | ||
func makeRegion(def string) *core.RegionInfo { |
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.
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
/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: 859d708
|
@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 |
In response to a cherrypick label: new pull request created to branch |
…egionFit (#7219) (#7245) close #7185 fix the issue of not being able to achieve the better RegionFit - try to replace the existing peer in another rulefit Signed-off-by: nolouch <[email protected]> Co-authored-by: nolouch <[email protected]> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
…egionFit (#7219) (#7244) close #7185 fix the issue of not being able to achieve the better RegionFit - try to replace the existing peer in another rulefit Signed-off-by: nolouch <[email protected]> Co-authored-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 #7185
What is changed and how does it work?
Check List
Tests
Release note