-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Using gt to make constraint test during rebalance #17324
base: main
Are you sure you want to change the base?
Conversation
❌ Gradle check result for 12364d5: 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? |
Signed-off-by: panguixin <[email protected]>
12364d5
to
d4e101a
Compare
❌ Gradle check result for d4e101a: 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? |
Signed-off-by: panguixin <[email protected]>
return (params) -> { | ||
int primaryShardCount = params.getNode().numPrimaryShards(); | ||
int allowedPrimaryShardCount = (int) Math.ceil(params.getBalancer().avgPrimaryShardsPerNode() * (1 + buffer)); | ||
return primaryShardCount >= allowedPrimaryShardCount; | ||
return rebalance ? primaryShardCount > allowedPrimaryShardCount : primaryShardCount >= allowedPrimaryShardCount; |
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.
using gt for comparison is equivalent to assigning the variable buffer
as 1/params.getBalancer().avgPrimaryShardsPerNode()
❌ Gradle check result for 9e1ad2e: 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? |
Description
Today, we use gte to make constraint test during allocation and rebalance.
OpenSearch/server/src/main/java/org/opensearch/cluster/routing/allocation/ConstraintTypes.java
Lines 71 to 73 in c82fffe
When the number of primary shards is not divisible by the number of nodes, nodes that are over-allocated primary shards are assigned a high weight, causing them to be unavailable for allocation of replicas during rebalance. The flaky test #14327 is the result of this.
Related 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.