-
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
Add remote shards allocator for searchable snapshots #4870
Add remote shards allocator for searchable snapshots #4870
Conversation
52660d0
to
ac4589e
Compare
Gradle Check (Jenkins) Run Completed with:
|
server/src/main/java/org/opensearch/common/util/FeatureFlags.java
Outdated
Show resolved
Hide resolved
Gradle Check (Jenkins) Run Completed with:
|
ac4589e
to
57ac40e
Compare
Gradle Check (Jenkins) Run Completed with:
|
57ac40e
to
25ed1be
Compare
Gradle Check (Jenkins) Run Completed with:
|
25ed1be
to
c0d9171
Compare
Gradle Check (Jenkins) Run Completed with:
|
Unrelated failures:
|
Gradle Check (Jenkins) Run Completed with:
|
|
private Queue<RoutingNode> getShuffledRemoteNodes() { | ||
Iterator<RoutingNode> nodesIter = routingNodes.mutableIterator(); | ||
List<RoutingNode> nodeList = new ArrayList<>(); | ||
while (nodesIter.hasNext()) { |
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.
Can you replace the mutable iterator and while loop with the following?
for (RoutingNode rNode : routingNodes) {
...
}
} | ||
|
||
/** | ||
* Performs heuristic based balancing for remote shards within the cluster. |
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.
Can you expand a bit here? For example, what is the heuristic being used here? Doesn't need to be super detailed, just a high level description of exactly what is being done.
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.
Done!
UnassignedIndexShards indexShards = unassignedShardMap.get(index); | ||
indexShards.addShard(shard); |
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.
Nitpick, but can probably just do:
unassignedShardMap.get(index).addShard(shard);
c0d9171
to
716c9f9
Compare
Gradle Check (Jenkins) Run Completed with:
|
0dffbf1
to
f4f6071
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
f4f6071
to
1b5bb28
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Seems related since the flag is forcefully turned on for
|
ObjectIntHashMap<String> primaryShardCount = new ObjectIntHashMap<>(); | ||
int totalPrimaryShard = 0; | ||
for (RoutingNode node : nodeList) { | ||
int totalPrimaryPerNode = 0; |
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.
What's the difference between totalPrimaryShard above and totalPrimaryPerNode? If the latter conveys totalPrimaryShardPerNode, we can rename it accordingly. If not, maybe a better variable name to distinguish would help here?
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.
Renamed. It was exactly what you figured out.
Simplified the logic and extracted it out.
|
||
ObjectIntHashMap<String> primaryShardCount = new ObjectIntHashMap<>(); | ||
int totalPrimaryShard = 0; | ||
for (RoutingNode node : nodeList) { |
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.
Can we extract this logic to a different method?
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.
Done.
} | ||
} | ||
|
||
private void allocateUnassigned( |
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.
Can we break this down to smaller methods? Looks difficult to follow.
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.
Done.
a54f7a3
to
ab5ce2e
Compare
Gradle Check (Jenkins) Run Completed with:
|
Unrelated failure:
|
ab5ce2e
to
3f5641e
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
3f5641e
to
01fdb8e
Compare
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Part of this commit was developed from code and concepts initially implemented in Amazon OpenSearch Service as part of the UltraWarm feature. Thank you to the following developers and the entire UltraWarm team. Co-authored-by: Min Zhou <minzho@amazon.com> Co-authored-by: Ankit Malpani <malpani@amazon.com> Co-authored-by: Rohit Nair <rohinair@amazon.com> Co-authored-by: Sorabh Hamirwasia <hsorabh@amazon.com> Co-authored-by: Ankit Jain <akjain@amazon.com> Co-authored-by: Tianru Zhou <tianruz@amazon.com> Co-authored-by: Neetika Singhal <neetiks@amazon.com> Co-authored-by: Amit Khandelwal <mkhnde@amazon.com> Co-authored-by: Vigya Sharma <vigyas@amazon.com> Co-authored-by: Prateek Sharma <shrprat@amazon.com> Co-authored-by: Venkata Jyothsna Donapati <donapv@amazon.com> Co-authored-by: Vlad Rozov <vrozov@amazon.com> Co-authored-by: Mohit Agrawal <agramohi@amazon.com> Co-authored-by: Shweta Thareja <tharejas@amazon.com> Co-authored-by: Palash Hedau <phhedau@amazon.com> Co-authored-by: Saurabh Singh <sisurab@amazon.com> Co-authored-by: Piyush Daftary <pdaftary@amazon.com> Co-authored-by: Payal Maheshwari <pmaheshw@amazon.com> Co-authored-by: Kunal Khatua <kkhatua@amazon.com> Co-authored-by: Gulshan Kumar <kumargu@amazon.com> Co-authored-by: Rushi Agrawal <agrrushi@amazon.com> Co-authored-by: Ketan Verma <vermketa@amazon.com> Co-authored-by: Gaurav Chandani <chngau@amazon.com> Co-authored-by: Dharmesh Singh <sdharms@amazon.com> Signed-off-by: Kunal Kotwani <kkotwani@amazon.com>
01fdb8e
to
694c89f
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Part of this commit was developed from code and concepts initially implemented in Amazon OpenSearch Service as part of the UltraWarm feature. Thank you to the following developers and the entire UltraWarm team. Co-authored-by: Min Zhou <minzho@amazon.com> Co-authored-by: Ankit Malpani <malpani@amazon.com> Co-authored-by: Rohit Nair <rohinair@amazon.com> Co-authored-by: Sorabh Hamirwasia <hsorabh@amazon.com> Co-authored-by: Ankit Jain <akjain@amazon.com> Co-authored-by: Tianru Zhou <tianruz@amazon.com> Co-authored-by: Neetika Singhal <neetiks@amazon.com> Co-authored-by: Amit Khandelwal <mkhnde@amazon.com> Co-authored-by: Vigya Sharma <vigyas@amazon.com> Co-authored-by: Prateek Sharma <shrprat@amazon.com> Co-authored-by: Venkata Jyothsna Donapati <donapv@amazon.com> Co-authored-by: Vlad Rozov <vrozov@amazon.com> Co-authored-by: Mohit Agrawal <agramohi@amazon.com> Co-authored-by: Shweta Thareja <tharejas@amazon.com> Co-authored-by: Palash Hedau <phhedau@amazon.com> Co-authored-by: Saurabh Singh <sisurab@amazon.com> Co-authored-by: Piyush Daftary <pdaftary@amazon.com> Co-authored-by: Payal Maheshwari <pmaheshw@amazon.com> Co-authored-by: Kunal Khatua <kkhatua@amazon.com> Co-authored-by: Gulshan Kumar <kumargu@amazon.com> Co-authored-by: Rushi Agrawal <agrrushi@amazon.com> Co-authored-by: Ketan Verma <vermketa@amazon.com> Co-authored-by: Gaurav Chandani <chngau@amazon.com> Co-authored-by: Dharmesh Singh <sdharms@amazon.com> Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Co-authored-by: Min Zhou <minzho@amazon.com> Co-authored-by: Ankit Malpani <malpani@amazon.com> Co-authored-by: Rohit Nair <rohinair@amazon.com> Co-authored-by: Sorabh Hamirwasia <hsorabh@amazon.com> Co-authored-by: Ankit Jain <akjain@amazon.com> Co-authored-by: Tianru Zhou <tianruz@amazon.com> Co-authored-by: Neetika Singhal <neetiks@amazon.com> Co-authored-by: Amit Khandelwal <mkhnde@amazon.com> Co-authored-by: Vigya Sharma <vigyas@amazon.com> Co-authored-by: Prateek Sharma <shrprat@amazon.com> Co-authored-by: Venkata Jyothsna Donapati <donapv@amazon.com> Co-authored-by: Vlad Rozov <vrozov@amazon.com> Co-authored-by: Mohit Agrawal <agramohi@amazon.com> Co-authored-by: Shweta Thareja <tharejas@amazon.com> Co-authored-by: Palash Hedau <phhedau@amazon.com> Co-authored-by: Saurabh Singh <sisurab@amazon.com> Co-authored-by: Piyush Daftary <pdaftary@amazon.com> Co-authored-by: Payal Maheshwari <pmaheshw@amazon.com> Co-authored-by: Kunal Khatua <kkhatua@amazon.com> Co-authored-by: Gulshan Kumar <kumargu@amazon.com> Co-authored-by: Rushi Agrawal <agrrushi@amazon.com> Co-authored-by: Ketan Verma <vermketa@amazon.com> Co-authored-by: Gaurav Chandani <chngau@amazon.com> Co-authored-by: Dharmesh Singh <sdharms@amazon.com> (cherry picked from commit 9119104) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Part of this commit was developed from code and concepts initially implemented in Amazon OpenSearch Service as part of the UltraWarm feature. Thank you to the following developers and the entire UltraWarm team. Co-authored-by: Min Zhou <minzho@amazon.com> Co-authored-by: Ankit Malpani <malpani@amazon.com> Co-authored-by: Rohit Nair <rohinair@amazon.com> Co-authored-by: Sorabh Hamirwasia <hsorabh@amazon.com> Co-authored-by: Ankit Jain <akjain@amazon.com> Co-authored-by: Tianru Zhou <tianruz@amazon.com> Co-authored-by: Neetika Singhal <neetiks@amazon.com> Co-authored-by: Amit Khandelwal <mkhnde@amazon.com> Co-authored-by: Vigya Sharma <vigyas@amazon.com> Co-authored-by: Prateek Sharma <shrprat@amazon.com> Co-authored-by: Venkata Jyothsna Donapati <donapv@amazon.com> Co-authored-by: Vlad Rozov <vrozov@amazon.com> Co-authored-by: Mohit Agrawal <agramohi@amazon.com> Co-authored-by: Shweta Thareja <tharejas@amazon.com> Co-authored-by: Palash Hedau <phhedau@amazon.com> Co-authored-by: Saurabh Singh <sisurab@amazon.com> Co-authored-by: Piyush Daftary <pdaftary@amazon.com> Co-authored-by: Payal Maheshwari <pmaheshw@amazon.com> Co-authored-by: Kunal Khatua <kkhatua@amazon.com> Co-authored-by: Gulshan Kumar <kumargu@amazon.com> Co-authored-by: Rushi Agrawal <agrrushi@amazon.com> Co-authored-by: Ketan Verma <vermketa@amazon.com> Co-authored-by: Gaurav Chandani <chngau@amazon.com> Co-authored-by: Dharmesh Singh <sdharms@amazon.com> Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Co-authored-by: Min Zhou <minzho@amazon.com> Co-authored-by: Ankit Malpani <malpani@amazon.com> Co-authored-by: Rohit Nair <rohinair@amazon.com> Co-authored-by: Sorabh Hamirwasia <hsorabh@amazon.com> Co-authored-by: Ankit Jain <akjain@amazon.com> Co-authored-by: Tianru Zhou <tianruz@amazon.com> Co-authored-by: Neetika Singhal <neetiks@amazon.com> Co-authored-by: Amit Khandelwal <mkhnde@amazon.com> Co-authored-by: Vigya Sharma <vigyas@amazon.com> Co-authored-by: Prateek Sharma <shrprat@amazon.com> Co-authored-by: Venkata Jyothsna Donapati <donapv@amazon.com> Co-authored-by: Vlad Rozov <vrozov@amazon.com> Co-authored-by: Mohit Agrawal <agramohi@amazon.com> Co-authored-by: Shweta Thareja <tharejas@amazon.com> Co-authored-by: Palash Hedau <phhedau@amazon.com> Co-authored-by: Saurabh Singh <sisurab@amazon.com> Co-authored-by: Piyush Daftary <pdaftary@amazon.com> Co-authored-by: Payal Maheshwari <pmaheshw@amazon.com> Co-authored-by: Kunal Khatua <kkhatua@amazon.com> Co-authored-by: Gulshan Kumar <kumargu@amazon.com> Co-authored-by: Rushi Agrawal <agrrushi@amazon.com> Co-authored-by: Ketan Verma <vermketa@amazon.com> Co-authored-by: Gaurav Chandani <chngau@amazon.com> Co-authored-by: Dharmesh Singh <sdharms@amazon.com> (cherry picked from commit 9119104) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
…5024) * Add remote allocator for searchable snapshots (#4870) Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Part of this commit was developed from code and concepts initially implemented in Amazon OpenSearch Service as part of the UltraWarm feature. Thank you to the following developers and the entire UltraWarm team. Co-authored-by: Min Zhou <minzho@amazon.com> Co-authored-by: Ankit Malpani <malpani@amazon.com> Co-authored-by: Rohit Nair <rohinair@amazon.com> Co-authored-by: Sorabh Hamirwasia <hsorabh@amazon.com> Co-authored-by: Ankit Jain <akjain@amazon.com> Co-authored-by: Tianru Zhou <tianruz@amazon.com> Co-authored-by: Neetika Singhal <neetiks@amazon.com> Co-authored-by: Amit Khandelwal <mkhnde@amazon.com> Co-authored-by: Vigya Sharma <vigyas@amazon.com> Co-authored-by: Prateek Sharma <shrprat@amazon.com> Co-authored-by: Venkata Jyothsna Donapati <donapv@amazon.com> Co-authored-by: Vlad Rozov <vrozov@amazon.com> Co-authored-by: Mohit Agrawal <agramohi@amazon.com> Co-authored-by: Shweta Thareja <tharejas@amazon.com> Co-authored-by: Palash Hedau <phhedau@amazon.com> Co-authored-by: Saurabh Singh <sisurab@amazon.com> Co-authored-by: Piyush Daftary <pdaftary@amazon.com> Co-authored-by: Payal Maheshwari <pmaheshw@amazon.com> Co-authored-by: Kunal Khatua <kkhatua@amazon.com> Co-authored-by: Gulshan Kumar <kumargu@amazon.com> Co-authored-by: Rushi Agrawal <agrrushi@amazon.com> Co-authored-by: Ketan Verma <vermketa@amazon.com> Co-authored-by: Gaurav Chandani <chngau@amazon.com> Co-authored-by: Dharmesh Singh <sdharms@amazon.com> Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> (cherry picked from commit 9119104) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md * Update changelog Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kunal Kotwani <kkotwani@amazon.com>
…5028) * Add remote allocator for searchable snapshots (#4870) Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Part of this commit was developed from code and concepts initially implemented in Amazon OpenSearch Service as part of the UltraWarm feature. Thank you to the following developers and the entire UltraWarm team. Co-authored-by: Min Zhou <minzho@amazon.com> Co-authored-by: Ankit Malpani <malpani@amazon.com> Co-authored-by: Rohit Nair <rohinair@amazon.com> Co-authored-by: Sorabh Hamirwasia <hsorabh@amazon.com> Co-authored-by: Ankit Jain <akjain@amazon.com> Co-authored-by: Tianru Zhou <tianruz@amazon.com> Co-authored-by: Neetika Singhal <neetiks@amazon.com> Co-authored-by: Amit Khandelwal <mkhnde@amazon.com> Co-authored-by: Vigya Sharma <vigyas@amazon.com> Co-authored-by: Prateek Sharma <shrprat@amazon.com> Co-authored-by: Venkata Jyothsna Donapati <donapv@amazon.com> Co-authored-by: Vlad Rozov <vrozov@amazon.com> Co-authored-by: Mohit Agrawal <agramohi@amazon.com> Co-authored-by: Shweta Thareja <tharejas@amazon.com> Co-authored-by: Palash Hedau <phhedau@amazon.com> Co-authored-by: Saurabh Singh <sisurab@amazon.com> Co-authored-by: Piyush Daftary <pdaftary@amazon.com> Co-authored-by: Payal Maheshwari <pmaheshw@amazon.com> Co-authored-by: Kunal Khatua <kkhatua@amazon.com> Co-authored-by: Gulshan Kumar <kumargu@amazon.com> Co-authored-by: Rushi Agrawal <agrrushi@amazon.com> Co-authored-by: Ketan Verma <vermketa@amazon.com> Co-authored-by: Gaurav Chandani <chngau@amazon.com> Co-authored-by: Dharmesh Singh <sdharms@amazon.com> Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Co-authored-by: Min Zhou <minzho@amazon.com> Co-authored-by: Ankit Malpani <malpani@amazon.com> Co-authored-by: Rohit Nair <rohinair@amazon.com> Co-authored-by: Sorabh Hamirwasia <hsorabh@amazon.com> Co-authored-by: Ankit Jain <akjain@amazon.com> Co-authored-by: Tianru Zhou <tianruz@amazon.com> Co-authored-by: Neetika Singhal <neetiks@amazon.com> Co-authored-by: Amit Khandelwal <mkhnde@amazon.com> Co-authored-by: Vigya Sharma <vigyas@amazon.com> Co-authored-by: Prateek Sharma <shrprat@amazon.com> Co-authored-by: Venkata Jyothsna Donapati <donapv@amazon.com> Co-authored-by: Vlad Rozov <vrozov@amazon.com> Co-authored-by: Mohit Agrawal <agramohi@amazon.com> Co-authored-by: Shweta Thareja <tharejas@amazon.com> Co-authored-by: Palash Hedau <phhedau@amazon.com> Co-authored-by: Saurabh Singh <sisurab@amazon.com> Co-authored-by: Piyush Daftary <pdaftary@amazon.com> Co-authored-by: Payal Maheshwari <pmaheshw@amazon.com> Co-authored-by: Kunal Khatua <kkhatua@amazon.com> Co-authored-by: Gulshan Kumar <kumargu@amazon.com> Co-authored-by: Rushi Agrawal <agrrushi@amazon.com> Co-authored-by: Ketan Verma <vermketa@amazon.com> Co-authored-by: Gaurav Chandani <chngau@amazon.com> Co-authored-by: Dharmesh Singh <sdharms@amazon.com> (cherry picked from commit 9119104) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md * Update changelog Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kunal Kotwani <kkotwani@amazon.com>
Signed-off-by: Kunal Kotwani kkotwani@amazon.com
Description
Issues Resolved
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.