-
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
[Segment Replication] Allocation and rebalancing based on average primary shard count per index #6422
[Segment Replication] Allocation and rebalancing based on average primary shard count per index #6422
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
fd7d113
to
df7c663
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: Suraj Singh <[email protected]>
Signed-off-by: Suraj Singh <[email protected]>
Signed-off-by: Suraj Singh <[email protected]>
Signed-off-by: Suraj Singh <[email protected]>
Signed-off-by: Suraj Singh <[email protected]>
5771038
to
b28fe2d
Compare
Signed-off-by: Suraj Singh <[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, thanks @dreamer-89.
Gradle Check (Jenkins) Run Completed with:
|
As this is core change, it will be good to have one more review. @shwetathareja @nknize @Bukhtawar @vigyasharma ping for review. Will wait for couple of days for review. |
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Suraj Singh <[email protected]>
Tracked in #5957 |
Gradle Check (Jenkins) Run Completed with:
|
Merging the changes now. |
…mary shard count per index (#6422) * [Segment Replication] Move primary shard first during rebalancing Signed-off-by: Suraj Singh <[email protected]> * Address review comments Signed-off-by: Suraj Singh <[email protected]> * Add primary weight constraint Signed-off-by: Suraj Singh <[email protected]> * Add average primary shard count constraint for allocation and rebalancing operation Signed-off-by: Suraj Singh <[email protected]> * Spotless fix and javadocs Signed-off-by: Suraj Singh <[email protected]> * Add failing tests Signed-off-by: Suraj Singh <[email protected]> * Fix unit tests Signed-off-by: Suraj Singh <[email protected]> * Add unit test for nodes breaching multiple constraints Signed-off-by: Suraj Singh <[email protected]> * Add comments and update unit test Signed-off-by: Suraj Singh <[email protected]> * Address review comments Signed-off-by: Suraj Singh <[email protected]> * Remove auto-expand replicas integration test Signed-off-by: Suraj Singh <[email protected]> * Address review comments Signed-off-by: Suraj Singh <[email protected]> * Update comments for tests Signed-off-by: Suraj Singh <[email protected]> * Add changelog entry Signed-off-by: Suraj Singh <[email protected]> * Remove extra changelog entry Signed-off-by: Suraj Singh <[email protected]> --------- Signed-off-by: Suraj Singh <[email protected]> (cherry picked from commit f61402a) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
No concerns, here. I haven't had a chance to dig deep on this but I did give it a quick once over. I like where this is going and great suggestion with the use of constraints. I think merging is fine so we can let it bake. I'll be giving another pass when I get back to teasing out the common server components. |
…mary shard count per index (#6422) (#6541) * [Segment Replication] Move primary shard first during rebalancing * Address review comments * Add primary weight constraint * Add average primary shard count constraint for allocation and rebalancing operation * Spotless fix and javadocs * Add failing tests * Fix unit tests * Add unit test for nodes breaching multiple constraints * Add comments and update unit test * Address review comments * Remove auto-expand replicas integration test * Address review comments * Update comments for tests * Add changelog entry * Remove extra changelog entry --------- (cherry picked from commit f61402a) Signed-off-by: Suraj Singh <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…mary shard count per index (opensearch-project#6422) * [Segment Replication] Move primary shard first during rebalancing Signed-off-by: Suraj Singh <[email protected]> * Address review comments Signed-off-by: Suraj Singh <[email protected]> * Add primary weight constraint Signed-off-by: Suraj Singh <[email protected]> * Add average primary shard count constraint for allocation and rebalancing operation Signed-off-by: Suraj Singh <[email protected]> * Spotless fix and javadocs Signed-off-by: Suraj Singh <[email protected]> * Add failing tests Signed-off-by: Suraj Singh <[email protected]> * Fix unit tests Signed-off-by: Suraj Singh <[email protected]> * Add unit test for nodes breaching multiple constraints Signed-off-by: Suraj Singh <[email protected]> * Add comments and update unit test Signed-off-by: Suraj Singh <[email protected]> * Address review comments Signed-off-by: Suraj Singh <[email protected]> * Remove auto-expand replicas integration test Signed-off-by: Suraj Singh <[email protected]> * Address review comments Signed-off-by: Suraj Singh <[email protected]> * Update comments for tests Signed-off-by: Suraj Singh <[email protected]> * Add changelog entry Signed-off-by: Suraj Singh <[email protected]> * Remove extra changelog entry Signed-off-by: Suraj Singh <[email protected]> --------- Signed-off-by: Suraj Singh <[email protected]> Signed-off-by: Mingshi Liu <[email protected]>
Description
This change adds average primary shard count per node constraint to both allocation and rebalancing operations and basically implements the approach 1 as mentioned in #6210
Changes
cluster.routing.allocation.balance.prefer_primary
defaults tofalse
. This setting defines if primary shard balance is needed or not.isPrimaryShardsPerIndexPerNodeBreached
which breaches when a node contains more than average primary shards of an index. When breached, the node weight calculation adds100k
to the node's weight resulting in lower chances for the node to be selected as target for unassigned shard allocation or relocation from rebalancing. Pleaset note, this is a soft limit which means even if node breaches constraint it can still be selected for allocation compared to hard limit from different allocation & rebalance deciders which removes node from allocation consideration.SameShardAllocationDecider
allocation decider.Issues Resolved
#6210
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.