-
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
Include file cache stats in node stats api response #6333
Conversation
Gradle Check (Jenkins) Run Completed with:
|
server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodeStats.java
Outdated
Show resolved
Hide resolved
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #6333 +/- ##
============================================
+ Coverage 70.71% 70.74% +0.03%
- Complexity 59011 59049 +38
============================================
Files 4800 4801 +1
Lines 282712 282798 +86
Branches 40763 40767 +4
============================================
+ Hits 199907 200073 +166
+ Misses 66427 66303 -124
- Partials 16378 16422 +44
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
} | ||
|
||
private Path getShardPath(ShardId shardId) throws IOException { | ||
final Path[] paths = nodeEnvironment.availableShardPaths(shardId); |
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.
We can potentially use the change from https://github.com/opensearch-project/OpenSearch/pull/6350/files#diff-64eed71f060448867b2456f621ebd72a43d52cd20db9080a82308978a0930a5a.
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.
Moving this to another PR as per Andrew's comment below, will address in there.
Is this related to the stats API at all? If not, can we split it out as a separate PR and commit? It'll be easier to review and make the commit history a bit clearer. |
We'll want to make sure that the new |
We can, in that case we have to merge the stats API code changes first before raising a PR for the cleaner as it depends on the former. |
+1 on this. LGTM otherwise. |
Gradle Check (Jenkins) Run Completed with:
|
@@ -171,6 +176,11 @@ public NodeStats(StreamInput in) throws IOException { | |||
} else { | |||
weightedRoutingStats = null; | |||
} | |||
if (in.getVersion().onOrAfter(Version.V_3_0_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.
I think we'll want to gate these writes behind the feature flag as well. We want to be able to make backwards-incompatible changes to this feature (like maybe remove this or change the structure) and not impact any instances that have not enabled the experimental feature flag. The only way to do that (I think) is to make sure we don't write anything over the wire unless the feature flag is turned on.
This change exposes the file cache stats as part the node stats API response. Signed-off-by: Rabi Panda <adnapibar@gmail.com>
Gradle Check (Jenkins) Run Completed with:
|
The backport to
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-6333-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 0f3b8705a982ac8cce43d57e235cc4e13fb3ae6f
# Push it to GitHub
git push --set-upstream origin backport/backport-6333-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 |
@adnapibar Looks like it needs a manual backport 🙂 |
) This change exposes the file cache stats as part the node stats API response. Signed-off-by: Rabi Panda <adnapibar@gmail.com> (cherry picked from commit 0f3b870)
Backport: #6485 |
* Include file cache stats in node stats response (#6333) This change exposes the file cache stats as part the node stats API response. Signed-off-by: Rabi Panda <adnapibar@gmail.com> (cherry picked from commit 0f3b870) * Add cache reservation logic (#6350) Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> (cherry picked from commit eb78246) --------- Co-authored-by: Rabi Panda <adnapibar@gmail.com>
Description
Follow up to the #5641. This change exposes the file cache stats as part the node stats API response. The file cache was added as part of searchable snapshot in #5641.
In addition this also adds an index event listener to clean up cache entries when a remote store index is deleted.Issues Resolved
Resolves #5982
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.