[Segment Replication] Allocation and rebalancing based on average primary shard count per index#6422
Merged
dreamer-89 merged 15 commits intoopensearch-project:mainfrom Mar 3, 2023
Conversation
6 tasks
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 <surajrider@gmail.com>
Signed-off-by: Suraj Singh <surajrider@gmail.com>
Signed-off-by: Suraj Singh <surajrider@gmail.com>
5771038 to
b28fe2d
Compare
Signed-off-by: Suraj Singh <surajrider@gmail.com>
Contributor
Gradle Check (Jenkins) Run Completed with:
|
Member
Author
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. |
Contributor
Gradle Check (Jenkins) Run Completed with:
|
andrross
reviewed
Mar 2, 2023
Signed-off-by: Suraj Singh <surajrider@gmail.com>
Member
Author
Tracked in #5957 |
Contributor
Gradle Check (Jenkins) Run Completed with:
|
Member
Author
|
Merging the changes now. |
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Mar 3, 2023
…mary shard count per index (#6422) * [Segment Replication] Move primary shard first during rebalancing Signed-off-by: Suraj Singh <surajrider@gmail.com> * Address review comments Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add primary weight constraint Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add average primary shard count constraint for allocation and rebalancing operation Signed-off-by: Suraj Singh <surajrider@gmail.com> * Spotless fix and javadocs Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add failing tests Signed-off-by: Suraj Singh <surajrider@gmail.com> * Fix unit tests Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add unit test for nodes breaching multiple constraints Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add comments and update unit test Signed-off-by: Suraj Singh <surajrider@gmail.com> * Address review comments Signed-off-by: Suraj Singh <surajrider@gmail.com> * Remove auto-expand replicas integration test Signed-off-by: Suraj Singh <surajrider@gmail.com> * Address review comments Signed-off-by: Suraj Singh <surajrider@gmail.com> * Update comments for tests Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add changelog entry Signed-off-by: Suraj Singh <surajrider@gmail.com> * Remove extra changelog entry Signed-off-by: Suraj Singh <surajrider@gmail.com> --------- Signed-off-by: Suraj Singh <surajrider@gmail.com> (cherry picked from commit f61402a) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Contributor
|
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. |
dreamer-89
pushed a commit
that referenced
this pull request
Mar 4, 2023
…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 <surajrider@gmail.com> 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>
This was referenced Mar 13, 2023
mingshl
pushed a commit
to mingshl/OpenSearch-Mingshl
that referenced
this pull request
Mar 24, 2023
…mary shard count per index (opensearch-project#6422) * [Segment Replication] Move primary shard first during rebalancing Signed-off-by: Suraj Singh <surajrider@gmail.com> * Address review comments Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add primary weight constraint Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add average primary shard count constraint for allocation and rebalancing operation Signed-off-by: Suraj Singh <surajrider@gmail.com> * Spotless fix and javadocs Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add failing tests Signed-off-by: Suraj Singh <surajrider@gmail.com> * Fix unit tests Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add unit test for nodes breaching multiple constraints Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add comments and update unit test Signed-off-by: Suraj Singh <surajrider@gmail.com> * Address review comments Signed-off-by: Suraj Singh <surajrider@gmail.com> * Remove auto-expand replicas integration test Signed-off-by: Suraj Singh <surajrider@gmail.com> * Address review comments Signed-off-by: Suraj Singh <surajrider@gmail.com> * Update comments for tests Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add changelog entry Signed-off-by: Suraj Singh <surajrider@gmail.com> * Remove extra changelog entry Signed-off-by: Suraj Singh <surajrider@gmail.com> --------- Signed-off-by: Suraj Singh <surajrider@gmail.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com>
This was referenced Feb 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_primarydefaults tofalse. This setting defines if primary shard balance is needed or not.isPrimaryShardsPerIndexPerNodeBreachedwhich breaches when a node contains more than average primary shards of an index. When breached, the node weight calculation adds100kto 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.SameShardAllocationDeciderallocation 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.