-
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] Add global primary shard balance constraint during allocation #6643
[Segment Replication] Add global primary shard balance constraint during allocation #6643
Conversation
…ing allocation Signed-off-by: Suraj Singh <surajrider@gmail.com>
@nknize @shwetathareja @Bukhtawar @mch2 : Request for review. |
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Suraj Singh <surajrider@gmail.com>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Suraj Singh <surajrider@gmail.com>
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #6643 +/- ##
============================================
- Coverage 70.76% 70.69% -0.07%
+ Complexity 59141 59137 -4
============================================
Files 4803 4804 +1
Lines 283187 283188 +1
Branches 40837 40837
============================================
- Hits 200384 200212 -172
- Misses 66340 66571 +231
+ Partials 16463 16405 -58
... and 479 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Cluster setup3 data nodes
Benchmark used
Index setting
Test steps performedStart benchmark (nyc_taxis here) and then shut down OpenSearch process on one data node. This should result in primaries be distributed in remaining two nodes. Once the node is brought up, shards are balanced. With Without primary balanceShard distribution
Benchmark report
With primary balance
Snapshot of shard distribution
Benchmark report
ComparisonWithout primary balance is used as baseline and run with prefer_primary setting to true as contender.
|
* balance per index and across all indices is maintained. | ||
* @throws Exception | ||
*/ | ||
public void testGlobalPrimaryAllocation() throws Exception { |
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.
Should we also add a test case here for allocation/rebalance post failover with these constraints? To simulate rebalance when a shard comes back full of replicas.
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.
Re-balancing is only performed at per index level today. So, allocation on a multiple index failover scenario wouldn't be predictible. The per index allocation/rebalancing scenario is covered in existing ITs. The global re-balancing is tracked in #6642
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 @dreamer-89, thanks for this change and providing all the perf benchmarks.
…ing allocation (#6643) * [Segment Replication] Add global primary shard balance constraint during allocation Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add javadoc Signed-off-by: Suraj Singh <surajrider@gmail.com> * Fix testAllConstraints test to include all constraints Signed-off-by: Suraj Singh <surajrider@gmail.com> --------- Signed-off-by: Suraj Singh <surajrider@gmail.com> (cherry picked from commit ad823b6) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ing allocation (#6643) (#6690) * [Segment Replication] Add global primary shard balance constraint during allocation * Add javadoc * Fix testAllConstraints test to include all constraints --------- (cherry picked from commit ad823b6) 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>
…ing allocation (opensearch-project#6643) * [Segment Replication] Add global primary shard balance constraint during allocation Signed-off-by: Suraj Singh <surajrider@gmail.com> * Add javadoc Signed-off-by: Suraj Singh <surajrider@gmail.com> * Fix testAllConstraints test to include all constraints Signed-off-by: Suraj Singh <surajrider@gmail.com> --------- Signed-off-by: Suraj Singh <surajrider@gmail.com> Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Description
This change is a follow up of #6422 where constraint based per index primary balance was introduced. This change adds a new constraint
isPrimaryShardsPerNodeBreached
which is marked breached if a node contains more than average number of primary shards across all indices. This is intentionally applied for allocation and will be applied for rebalancing as fast follow up tracked in #6642Issues 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.