-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix weight calculation of decideRebalance when explain #17720
Fix weight calculation of decideRebalance when explain #17720
Conversation
Signed-off-by: gesong.samuel <[email protected]>
❌ Gradle check result for 01331d5: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
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 changes looks good to me!
❌ Gradle check result for 01331d5: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❕ Gradle check result for 01331d5: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17720 +/- ##
============================================
+ Coverage 72.46% 72.53% +0.06%
- Complexity 65855 65921 +66
============================================
Files 5322 5322
Lines 305477 305477
Branches 44312 44312
============================================
+ Hits 221359 221572 +213
+ Misses 66023 65729 -294
- Partials 18095 18176 +81 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b5195f4
into
opensearch-project:main
Description
The explain api
POST _cluster/allocation/explain
, explains how an allocation decision is made, but during the calculation ofcurrentWeight
inOpenSearch/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/LocalShardsBalancer.java
Line 209 in 399188f
, it uses original
weight
function which does not consider allocation/rebalance constraint:OpenSearch/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/LocalShardsBalancer.java
Lines 234 to 238 in 399188f
However the following calculation uses the new
weightWithRebalanceConstraints
, which is correctOpenSearch/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/LocalShardsBalancer.java
Lines 250 to 254 in 399188f
So change the former calculation of currentNode weight to use the new
weightWithRebalanceConstraints
functionRelated Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.