-
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
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 <[email protected]> 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 <[email protected]> Co-authored-by: Ankit Malpani <[email protected]> Co-authored-by: Rohit Nair <[email protected]> Co-authored-by: Sorabh Hamirwasia <[email protected]> Co-authored-by: Ankit Jain <[email protected]> Co-authored-by: Tianru Zhou <[email protected]> Co-authored-by: Neetika Singhal <[email protected]> Co-authored-by: Amit Khandelwal <[email protected]> Co-authored-by: Vigya Sharma <[email protected]> Co-authored-by: Prateek Sharma <[email protected]> Co-authored-by: Venkata Jyothsna Donapati <[email protected]> Co-authored-by: Vlad Rozov <[email protected]> Co-authored-by: Mohit Agrawal <[email protected]> Co-authored-by: Shweta Thareja <[email protected]> Co-authored-by: Palash Hedau <[email protected]> Co-authored-by: Saurabh Singh <[email protected]> Co-authored-by: Piyush Daftary <[email protected]> Co-authored-by: Payal Maheshwari <[email protected]> Co-authored-by: Kunal Khatua <[email protected]> Co-authored-by: Gulshan Kumar <[email protected]> Co-authored-by: Rushi Agrawal <[email protected]> Co-authored-by: Ketan Verma <[email protected]> Co-authored-by: Gaurav Chandani <[email protected]> Co-authored-by: Dharmesh Singh <[email protected]> Signed-off-by: Kunal Kotwani <[email protected]>
01fdb8e
to
694c89f
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Kunal Kotwani <[email protected]> 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 <[email protected]> Co-authored-by: Ankit Malpani <[email protected]> Co-authored-by: Rohit Nair <[email protected]> Co-authored-by: Sorabh Hamirwasia <[email protected]> Co-authored-by: Ankit Jain <[email protected]> Co-authored-by: Tianru Zhou <[email protected]> Co-authored-by: Neetika Singhal <[email protected]> Co-authored-by: Amit Khandelwal <[email protected]> Co-authored-by: Vigya Sharma <[email protected]> Co-authored-by: Prateek Sharma <[email protected]> Co-authored-by: Venkata Jyothsna Donapati <[email protected]> Co-authored-by: Vlad Rozov <[email protected]> Co-authored-by: Mohit Agrawal <[email protected]> Co-authored-by: Shweta Thareja <[email protected]> Co-authored-by: Palash Hedau <[email protected]> Co-authored-by: Saurabh Singh <[email protected]> Co-authored-by: Piyush Daftary <[email protected]> Co-authored-by: Payal Maheshwari <[email protected]> Co-authored-by: Kunal Khatua <[email protected]> Co-authored-by: Gulshan Kumar <[email protected]> Co-authored-by: Rushi Agrawal <[email protected]> Co-authored-by: Ketan Verma <[email protected]> Co-authored-by: Gaurav Chandani <[email protected]> Co-authored-by: Dharmesh Singh <[email protected]> Signed-off-by: Kunal Kotwani <[email protected]> Signed-off-by: Kunal Kotwani <[email protected]> Co-authored-by: Min Zhou <[email protected]> Co-authored-by: Ankit Malpani <[email protected]> Co-authored-by: Rohit Nair <[email protected]> Co-authored-by: Sorabh Hamirwasia <[email protected]> Co-authored-by: Ankit Jain <[email protected]> Co-authored-by: Tianru Zhou <[email protected]> Co-authored-by: Neetika Singhal <[email protected]> Co-authored-by: Amit Khandelwal <[email protected]> Co-authored-by: Vigya Sharma <[email protected]> Co-authored-by: Prateek Sharma <[email protected]> Co-authored-by: Venkata Jyothsna Donapati <[email protected]> Co-authored-by: Vlad Rozov <[email protected]> Co-authored-by: Mohit Agrawal <[email protected]> Co-authored-by: Shweta Thareja <[email protected]> Co-authored-by: Palash Hedau <[email protected]> Co-authored-by: Saurabh Singh <[email protected]> Co-authored-by: Piyush Daftary <[email protected]> Co-authored-by: Payal Maheshwari <[email protected]> Co-authored-by: Kunal Khatua <[email protected]> Co-authored-by: Gulshan Kumar <[email protected]> Co-authored-by: Rushi Agrawal <[email protected]> Co-authored-by: Ketan Verma <[email protected]> Co-authored-by: Gaurav Chandani <[email protected]> Co-authored-by: Dharmesh Singh <[email protected]> (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 <[email protected]> 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 <[email protected]> Co-authored-by: Ankit Malpani <[email protected]> Co-authored-by: Rohit Nair <[email protected]> Co-authored-by: Sorabh Hamirwasia <[email protected]> Co-authored-by: Ankit Jain <[email protected]> Co-authored-by: Tianru Zhou <[email protected]> Co-authored-by: Neetika Singhal <[email protected]> Co-authored-by: Amit Khandelwal <[email protected]> Co-authored-by: Vigya Sharma <[email protected]> Co-authored-by: Prateek Sharma <[email protected]> Co-authored-by: Venkata Jyothsna Donapati <[email protected]> Co-authored-by: Vlad Rozov <[email protected]> Co-authored-by: Mohit Agrawal <[email protected]> Co-authored-by: Shweta Thareja <[email protected]> Co-authored-by: Palash Hedau <[email protected]> Co-authored-by: Saurabh Singh <[email protected]> Co-authored-by: Piyush Daftary <[email protected]> Co-authored-by: Payal Maheshwari <[email protected]> Co-authored-by: Kunal Khatua <[email protected]> Co-authored-by: Gulshan Kumar <[email protected]> Co-authored-by: Rushi Agrawal <[email protected]> Co-authored-by: Ketan Verma <[email protected]> Co-authored-by: Gaurav Chandani <[email protected]> Co-authored-by: Dharmesh Singh <[email protected]> Signed-off-by: Kunal Kotwani <[email protected]> Signed-off-by: Kunal Kotwani <[email protected]> Co-authored-by: Min Zhou <[email protected]> Co-authored-by: Ankit Malpani <[email protected]> Co-authored-by: Rohit Nair <[email protected]> Co-authored-by: Sorabh Hamirwasia <[email protected]> Co-authored-by: Ankit Jain <[email protected]> Co-authored-by: Tianru Zhou <[email protected]> Co-authored-by: Neetika Singhal <[email protected]> Co-authored-by: Amit Khandelwal <[email protected]> Co-authored-by: Vigya Sharma <[email protected]> Co-authored-by: Prateek Sharma <[email protected]> Co-authored-by: Venkata Jyothsna Donapati <[email protected]> Co-authored-by: Vlad Rozov <[email protected]> Co-authored-by: Mohit Agrawal <[email protected]> Co-authored-by: Shweta Thareja <[email protected]> Co-authored-by: Palash Hedau <[email protected]> Co-authored-by: Saurabh Singh <[email protected]> Co-authored-by: Piyush Daftary <[email protected]> Co-authored-by: Payal Maheshwari <[email protected]> Co-authored-by: Kunal Khatua <[email protected]> Co-authored-by: Gulshan Kumar <[email protected]> Co-authored-by: Rushi Agrawal <[email protected]> Co-authored-by: Ketan Verma <[email protected]> Co-authored-by: Gaurav Chandani <[email protected]> Co-authored-by: Dharmesh Singh <[email protected]> (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 <[email protected]> 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 <[email protected]> Co-authored-by: Ankit Malpani <[email protected]> Co-authored-by: Rohit Nair <[email protected]> Co-authored-by: Sorabh Hamirwasia <[email protected]> Co-authored-by: Ankit Jain <[email protected]> Co-authored-by: Tianru Zhou <[email protected]> Co-authored-by: Neetika Singhal <[email protected]> Co-authored-by: Amit Khandelwal <[email protected]> Co-authored-by: Vigya Sharma <[email protected]> Co-authored-by: Prateek Sharma <[email protected]> Co-authored-by: Venkata Jyothsna Donapati <[email protected]> Co-authored-by: Vlad Rozov <[email protected]> Co-authored-by: Mohit Agrawal <[email protected]> Co-authored-by: Shweta Thareja <[email protected]> Co-authored-by: Palash Hedau <[email protected]> Co-authored-by: Saurabh Singh <[email protected]> Co-authored-by: Piyush Daftary <[email protected]> Co-authored-by: Payal Maheshwari <[email protected]> Co-authored-by: Kunal Khatua <[email protected]> Co-authored-by: Gulshan Kumar <[email protected]> Co-authored-by: Rushi Agrawal <[email protected]> Co-authored-by: Ketan Verma <[email protected]> Co-authored-by: Gaurav Chandani <[email protected]> Co-authored-by: Dharmesh Singh <[email protected]> Signed-off-by: Kunal Kotwani <[email protected]> (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 <[email protected]> Signed-off-by: Kunal Kotwani <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kunal Kotwani <[email protected]>
…5028) * Add remote allocator for searchable snapshots (#4870) Signed-off-by: Kunal Kotwani <[email protected]> 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 <[email protected]> Co-authored-by: Ankit Malpani <[email protected]> Co-authored-by: Rohit Nair <[email protected]> Co-authored-by: Sorabh Hamirwasia <[email protected]> Co-authored-by: Ankit Jain <[email protected]> Co-authored-by: Tianru Zhou <[email protected]> Co-authored-by: Neetika Singhal <[email protected]> Co-authored-by: Amit Khandelwal <[email protected]> Co-authored-by: Vigya Sharma <[email protected]> Co-authored-by: Prateek Sharma <[email protected]> Co-authored-by: Venkata Jyothsna Donapati <[email protected]> Co-authored-by: Vlad Rozov <[email protected]> Co-authored-by: Mohit Agrawal <[email protected]> Co-authored-by: Shweta Thareja <[email protected]> Co-authored-by: Palash Hedau <[email protected]> Co-authored-by: Saurabh Singh <[email protected]> Co-authored-by: Piyush Daftary <[email protected]> Co-authored-by: Payal Maheshwari <[email protected]> Co-authored-by: Kunal Khatua <[email protected]> Co-authored-by: Gulshan Kumar <[email protected]> Co-authored-by: Rushi Agrawal <[email protected]> Co-authored-by: Ketan Verma <[email protected]> Co-authored-by: Gaurav Chandani <[email protected]> Co-authored-by: Dharmesh Singh <[email protected]> Signed-off-by: Kunal Kotwani <[email protected]> Signed-off-by: Kunal Kotwani <[email protected]> Co-authored-by: Min Zhou <[email protected]> Co-authored-by: Ankit Malpani <[email protected]> Co-authored-by: Rohit Nair <[email protected]> Co-authored-by: Sorabh Hamirwasia <[email protected]> Co-authored-by: Ankit Jain <[email protected]> Co-authored-by: Tianru Zhou <[email protected]> Co-authored-by: Neetika Singhal <[email protected]> Co-authored-by: Amit Khandelwal <[email protected]> Co-authored-by: Vigya Sharma <[email protected]> Co-authored-by: Prateek Sharma <[email protected]> Co-authored-by: Venkata Jyothsna Donapati <[email protected]> Co-authored-by: Vlad Rozov <[email protected]> Co-authored-by: Mohit Agrawal <[email protected]> Co-authored-by: Shweta Thareja <[email protected]> Co-authored-by: Palash Hedau <[email protected]> Co-authored-by: Saurabh Singh <[email protected]> Co-authored-by: Piyush Daftary <[email protected]> Co-authored-by: Payal Maheshwari <[email protected]> Co-authored-by: Kunal Khatua <[email protected]> Co-authored-by: Gulshan Kumar <[email protected]> Co-authored-by: Rushi Agrawal <[email protected]> Co-authored-by: Ketan Verma <[email protected]> Co-authored-by: Gaurav Chandani <[email protected]> Co-authored-by: Dharmesh Singh <[email protected]> (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 <[email protected]> Signed-off-by: Kunal Kotwani <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kunal Kotwani <[email protected]>
Signed-off-by: Kunal Kotwani [email protected]
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.