-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
De-duping shards in ShardsBatchGatewayAllocator based on ShardId inst… #13710
De-duping shards in ShardsBatchGatewayAllocator based on ShardId inst… #13710
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13710 +/- ##
============================================
+ Coverage 71.42% 71.57% +0.15%
- Complexity 59978 61274 +1296
============================================
Files 4985 5060 +75
Lines 282275 287856 +5581
Branches 40946 41689 +743
============================================
+ Hits 201603 206023 +4420
- Misses 63999 64817 +818
- Partials 16673 17016 +343 ☔ View full report in Codecov by Sentry. |
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.
Changes look good in perspective of fixing the bug @rajiv-kv. Can we have a follow up issue where we can look into the optimization where if there multiple replicas of a shard, we don't need n round of reroutes/fetches to get them assigned? It would be good to see that optimization in future.
85a748d
to
e4c0cc6
Compare
❌ Gradle check result for e4c0cc6: 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? |
server/src/main/java/org/opensearch/gateway/ShardsBatchGatewayAllocator.java
Show resolved
Hide resolved
…ead of ShardRouting#equals Signed-off-by: Rajiv Kumar Vaidyanathan <rajivkv@amazon.com>
e4c0cc6
to
8ee9ae4
Compare
…ead of ShardRouting#equals (opensearch-project#13710) Signed-off-by: Rajiv Kumar Vaidyanathan <rajivkv@amazon.com>
…ead of ShardRouting#equals (opensearch-project#13710) Signed-off-by: Rajiv Kumar Vaidyanathan <rajivkv@amazon.com>
…ead of ShardRouting#equals (opensearch-project#13710) (opensearch-project#14111) Signed-off-by: Rajiv Kumar Vaidyanathan <rajivkv@amazon.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: kkewwei <kkewwei@163.com>
Description
ShardsBatchGatewayAllocator de-dupes the unassigned Shards based on ShardRouting. If index is configured with muliple replicas, there will be multiple ShardRouting entries for same replica shard. The equals comparison of ShardRouting includes comparison based on <ShardMetada, UnassignedInfo>. This can cause incorrect de-duplication if UnassignedInfo is different for Replica copies. Hence changing the implementation to de-dupe based on ShardId, so that only one entry is created in cache and there are no duplicate entries across batches.
Related Issues
Resolves #[13705]
Check List
API changes companion pull request created.Public documentation issue/PR createdBy 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.