[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❌ Patch coverage is
Additional details and impacted files@@ 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 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Cluster setup3 data nodes Benchmark usedIndex settingTest 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 distributionBenchmark reportWith primary balanceSnapshot of shard distributionBenchmark reportComparisonWithout 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.
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.
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
mch2
left a comment
There was a problem hiding this comment.
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
isPrimaryShardsPerNodeBreachedwhich 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.