-
Notifications
You must be signed in to change notification settings - Fork 727
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
placement: improve regoin fit (#2639) #2720
Conversation
Signed-off-by: ti-srebot <[email protected]>
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
@JmPotato,Thanks for your review. However, LGTM is restricted to Reviewers or higher roles.See the corresponding SIG page for more information. Related SIGs: scheduling(slack). |
LGTM |
Codecov Report
@@ Coverage Diff @@
## release-4.0 #2720 +/- ##
===============================================
+ Coverage 77.45% 77.46% +0.01%
===============================================
Files 206 206
Lines 22473 22490 +17
===============================================
+ Hits 17406 17422 +16
Misses 3757 3757
- Partials 1310 1311 +1
Continue to review full report at Codecov.
|
/run-all-tests |
/merge |
/run-all-tests |
cherry-pick #2639 to release-4.0
What problem does this PR solve?
When we fit region's peers into rules, we check rules one by one, and for each one, we pick the best option (if there are multiple best options we simply pick the first one). The problem is that the current choice will affect subsequent rules, so the current optimal option is not necessarily the global optimal option.
For example, a region has 4 peers:
[host=h1, host=h2, host=h3, host=h4]
, and it matches 2 rules:3 voters
+1 voter on h2
. The best choice is[host=h1, host=h3, host=h4]
goes to the first rule and[host=h2]
goes to the second rule. Without consider globally, the first rule may pick[host=h1, host=h2, host=h3]
and left[host=h4]
which is not suitable for the second rule.The problem is originally brought up from #2626
What is changed and how it works?
Recursive all options to choose the global best.
Check List
Tests
Release note