Skip to content

[Remote Store] Add Remote store stats api#7441

Merged
gbbafna merged 20 commits intoopensearch-project:mainfrom
linuxpi:remote-store-segment-stats-api
May 18, 2023
Merged

[Remote Store] Add Remote store stats api#7441
gbbafna merged 20 commits intoopensearch-project:mainfrom
linuxpi:remote-store-segment-stats-api

Conversation

@linuxpi
Copy link
Copy Markdown
Contributor

@linuxpi linuxpi commented May 5, 2023

Description

Adds api to expose stats related to remote segment store for an index/shard

API Response

{
  "_shards" : {
    "total" : 2,
    "successful" : 1,
    "failed" : 0
  },
  "stats" : [
    {
      "shard_id" : "[my-index-1][0]",
      "local_refresh_timestamp_in_millis" : 196439653,
      "local_refresh_cumulative_count" : 0,
      "remote_refresh_timestamp_in_millis" : 196439653,
      "remote_refresh_cumulative_count" : 0,
      "bytes_lag" : 0,
      "rejection_count" : 0,
      "consecutive_failure_count" : 0,
      "total_remote_refresh" : {
        "started" : 0,
        "succeeded" : 0,
        "failed" : 0
      },
      "total_uploads_in_bytes" : {
        "started" : 0,
        "succeeded" : 0,
        "failed" : 0
      },
      "remote_refresh_size_in_bytes" : {
        "last_successful" : 0,
        "moving_avg" : 0.0
      },
      "upload_latency_in_bytes_per_sec" : {
        "moving_avg" : 0.0
      },
      "remote_refresh_latency_in_nanos" : {
        "moving_avg" : 0.0
      }
    }
  ]
}

Related Issues

Resolves #7153

Check List

  • [Y] New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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.

@linuxpi linuxpi force-pushed the remote-store-segment-stats-api branch from eb6ff6a to 7a567b0 Compare May 5, 2023 05:10
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 5, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 5, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 5, 2023

Gradle Check (Jenkins) Run Completed with:

@linuxpi linuxpi force-pushed the remote-store-segment-stats-api branch from 7fd5957 to 859ac4b Compare May 5, 2023 13:32
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 5, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 8, 2023

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2023

Codecov Report

Merging #7441 (ecb83ae) into main (f581ee2) will increase coverage by 0.00%.
The diff coverage is 72.81%.

@@            Coverage Diff             @@
##               main    #7441    +/-   ##
==========================================
  Coverage     70.52%   70.53%            
- Complexity    59656    59780   +124     
==========================================
  Files          4896     4903     +7     
  Lines        286779   286996   +217     
  Branches      41331    41340     +9     
==========================================
+ Hits         202255   202430   +175     
- Misses        67830    67967   +137     
+ Partials      16694    16599    -95     
Impacted Files Coverage Δ
...otestore/stats/RemoteStoreStatsRequestBuilder.java 0.00% <0.00%> (ø)
.../org/opensearch/client/support/AbstractClient.java 30.61% <0.00%> (-0.73%) ⬇️
...tion/admin/cluster/RestRemoteStoreStatsAction.java 28.57% <28.57%> (ø)
...testore/stats/TransportRemoteStoreStatsAction.java 41.66% <41.66%> (ø)
...er/remotestore/stats/RemoteStoreStatsResponse.java 47.05% <47.05%> (ø)
...in/cluster/remotestore/stats/RemoteStoreStats.java 95.12% <95.12%> (ø)
...arch/index/remote/RemoteRefreshSegmentTracker.java 88.42% <97.18%> (+5.22%) ⬆️
.../main/java/org/opensearch/action/ActionModule.java 96.51% <100.00%> (+0.01%) ⬆️
...ster/remotestore/stats/RemoteStoreStatsAction.java 100.00% <100.00%> (ø)
...ter/remotestore/stats/RemoteStoreStatsRequest.java 100.00% <100.00%> (ø)

... and 482 files with indirect coverage changes

@linuxpi linuxpi force-pushed the remote-store-segment-stats-api branch from c7a4f78 to 2998929 Compare May 8, 2023 06:01
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 8, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.cluster.routing.allocation.decider.DiskThresholdDeciderIT.testIndexCreateBlockIsRemovedWhenAnyNodesNotExceedHighWatermarkWithAutoReleaseEnabled

@linuxpi linuxpi changed the title Add Remote store stats api [Remote Store] Add Remote store stats api May 8, 2023
@linuxpi linuxpi force-pushed the remote-store-segment-stats-api branch from 2998929 to 6e9a281 Compare May 9, 2023 09:26
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 9, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.remotestore.SegmentReplicationRemoteStoreIT.testReplicaHasDiffFilesThanPrimary
      1 org.opensearch.indices.replication.SegmentReplicationIT.testScrollWithOngoingSegmentReplication

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@linuxpi linuxpi force-pushed the remote-store-segment-stats-api branch 2 times, most recently from ce03afb to 12b8728 Compare May 15, 2023 03:47
@linuxpi linuxpi marked this pull request as ready for review May 15, 2023 03:49
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: bansvaru <bansvaru@amazon.com>
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@linuxpi linuxpi force-pushed the remote-store-segment-stats-api branch from 794c006 to 004c016 Compare May 17, 2023 14:54
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@linuxpi linuxpi force-pushed the remote-store-segment-stats-api branch from 004c016 to 44d76a0 Compare May 17, 2023 15:18
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@linuxpi linuxpi force-pushed the remote-store-segment-stats-api branch 2 times, most recently from 4419101 to a938e64 Compare May 17, 2023 17:11
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      2 org.opensearch.remotestore.RemoteStoreRefreshListenerIT.testRemoteRefreshRetryOnFailure
      1 org.opensearch.indices.replication.SegmentReplicationRelocationIT.testPrimaryRelocationWithSegRepFailure

Signed-off-by: bansvaru <bansvaru@amazon.com>
@linuxpi linuxpi force-pushed the remote-store-segment-stats-api branch from a938e64 to 3747f29 Compare May 17, 2023 19:13
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: bansvaru <bansvaru@amazon.com>
@linuxpi linuxpi force-pushed the remote-store-segment-stats-api branch from 18bbec8 to ecb83ae Compare May 18, 2023 02:59
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.remotestore.RemoteStoreRefreshListenerIT.testRemoteRefreshRetryOnFailure

Copy link
Copy Markdown
Contributor

@gbbafna gbbafna left a comment

Choose a reason for hiding this comment

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

Please create a backlog item to aggregate on index/node and cluster level.

Also we are not handling any bwc here. So API won't work during version upgrades which should be fine as it is experimental.

@gbbafna gbbafna merged commit c369090 into opensearch-project:main May 18, 2023
@gbbafna gbbafna added the backport 2.x Backport to 2.x branch label May 19, 2023
@opensearch-trigger-bot
Copy link
Copy Markdown
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:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-7441-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c3690908a91dcb06646442a32ee5a49b87dc35c7
# Push it to GitHub
git push --set-upstream origin backport/backport-7441-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

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

linuxpi added a commit to linuxpi/OpenSearch that referenced this pull request May 23, 2023
Signed-off-by: Varun Bansal <bansvaru@amazon.com>
(cherry picked from commit c369090)
gbbafna pushed a commit that referenced this pull request May 23, 2023
Signed-off-by: Varun Bansal <bansvaru@amazon.com>
(cherry picked from commit c369090)
ashking94 pushed a commit to ashking94/OpenSearch that referenced this pull request May 24, 2023
Signed-off-by: Varun Bansal <bansvaru@amazon.com>
Signed-off-by: Ashish Singh <ssashish@amazon.com>
stephen-crawford pushed a commit to stephen-crawford/OpenSearch that referenced this pull request May 31, 2023
Signed-off-by: Varun Bansal <bansvaru@amazon.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
Signed-off-by: Varun Bansal <bansvaru@amazon.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
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 skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] [Remote Store] Remote Store Stats API

6 participants