Skip to content
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

Optimizing get indices to segments map calculations for IndicesSegmen… #14717

Merged
merged 8 commits into from
Sep 4, 2024

Conversation

gargharsh3134
Copy link
Contributor

@gargharsh3134 gargharsh3134 commented Jul 11, 2024

Description

Removes extra computations to get the indices to IndexSegments map which will help reduce the latencies for _cat/segments and other REST APIs

Related Issues

Resolves #14720

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

Copy link
Contributor

✅ Gradle check result for cdc2809: SUCCESS

Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.97%. Comparing base (a60b668) to head (4990514).
Report is 15 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14717      +/-   ##
============================================
+ Coverage     71.93%   71.97%   +0.03%     
- Complexity    63995    64048      +53     
============================================
  Files          5259     5259              
  Lines        299435   299437       +2     
  Branches      43270    43269       -1     
============================================
+ Hits         215412   215532     +120     
+ Misses        66287    66221      -66     
+ Partials      17736    17684      -52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added bug Something isn't working Cluster Manager labels Jul 11, 2024
@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added stalled Issues that have stalled and removed stalled Issues that have stalled labels Aug 15, 2024
@github-actions github-actions bot added the good first issue Good for newcomers label Aug 19, 2024
Copy link
Contributor

❌ Gradle check result for 637dccb: 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?

Signed-off-by: Harsh Garg <[email protected]>
Copy link
Contributor

❌ Gradle check result for 241ca48: 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?

Copy link
Contributor

@backslasht backslasht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for making the changes @gargharsh3134

Copy link
Contributor

github-actions bot commented Sep 4, 2024

❌ Gradle check result for ccca45e: 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?

@shwetathareja
Copy link
Member

@gargharsh3134 observing this error

> Task :server:forbiddenApisTest
Forbidden method invocation: java.util.Collections#shuffle(java.util.List) [Use java.util.Collections#shuffle(java.util.List, java.util.Random) with a reproducible source of randomness]
  in org.opensearch.action.admin.indices.segments.IndicesSegmentResponseTests (IndicesSegmentResponseTests.java:99)

Signed-off-by: Harsh Garg <[email protected]>
@gargharsh3134
Copy link
Contributor Author

@gargharsh3134 observing this error

> Task :server:forbiddenApisTest
Forbidden method invocation: java.util.Collections#shuffle(java.util.List) [Use java.util.Collections#shuffle(java.util.List, java.util.Random) with a reproducible source of randomness]
  in org.opensearch.action.admin.indices.segments.IndicesSegmentResponseTests (IndicesSegmentResponseTests.java:99)

Addressed in the latest commit. Thanks!

Copy link
Contributor

github-actions bot commented Sep 4, 2024

❌ Gradle check result for 4990514: 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?

Copy link
Contributor

github-actions bot commented Sep 4, 2024

❌ Gradle check result for 4990514: null

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?

Copy link
Contributor

github-actions bot commented Sep 4, 2024

❌ Gradle check result for 4990514: 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?

Copy link
Contributor

github-actions bot commented Sep 4, 2024

❌ Gradle check result for 4990514: 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?

Copy link
Contributor

github-actions bot commented Sep 4, 2024

❕ Gradle check result for 4990514: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@shwetathareja shwetathareja merged commit d28fbc3 into opensearch-project:main Sep 4, 2024
34 checks passed
@shwetathareja shwetathareja added the backport 2.x Backport to 2.x branch label Sep 4, 2024
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-14717-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d28fbc3bc2a4fbf0a70558e775e3f7a9e15d2617
# Push it to GitHub
git push --set-upstream origin backport/backport-14717-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-14717-to-2.x.

akolarkunnu pushed a commit to akolarkunnu/OpenSearch that referenced this pull request Sep 10, 2024
opensearch-project#14717)

* Optimizing get indices to segments map calculations for IndicesSegmentResponse class

Signed-off-by: Harsh Garg <[email protected]>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 16, 2024
opensearch-project#14717)

* Optimizing get indices to segments map calculations for IndicesSegmentResponse class

Signed-off-by: Harsh Garg <[email protected]>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 17, 2024
opensearch-project#14717)

* Optimizing get indices to segments map calculations for IndicesSegmentResponse class

Signed-off-by: Harsh Garg <[email protected]>
gbbafna pushed a commit that referenced this pull request Oct 21, 2024
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 21, 2024
opensearch-project#14717)

* Optimizing get indices to segments map calculations for IndicesSegmentResponse class

Signed-off-by: Harsh Garg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport-failed bug Something isn't working Cluster Manager good first issue Good for newcomers skip-changelog
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[BUG] High number of unnecessary computations in getIndices() of IndicesSegmentResponse
4 participants