[Backport 2.x] [Tiered Caching] Stats rework (2/4): Gates CacheStatsHolder logic behind FeatureFlags.PLUGGABLE_CACHE setting#13432
Merged
VachaShah merged 1 commit intoopensearch-project:2.xfrom Apr 29, 2024
Conversation
…GABLE_CACHE setting (opensearch-project#13238) Stats rework step 2 of 4 --------- Signed-off-by: Peter Alfonsi <petealft@amazon.com> Co-authored-by: Peter Alfonsi <petealft@amazon.com> (cherry picked from commit f84d28d)
Contributor
|
❕ Gradle check result for d730b30: 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.x #13432 +/- ##
============================================
- Coverage 71.28% 71.12% -0.16%
- Complexity 60145 60814 +669
============================================
Files 4957 5021 +64
Lines 282799 286422 +3623
Branches 41409 41849 +440
============================================
+ Hits 201591 203719 +2128
- Misses 64189 65474 +1285
- Partials 17019 17229 +210 ☔ View full report in Codecov by Sentry. |
Contributor
Author
VachaShah
approved these changes
Apr 29, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original PR
Description
Part of tiered caching stats. Tiered/pluggable caching is currently an experimental feature with the feature flag PLUGGABLE_CACHE. We want to gate the new CacheStatsHolder logic, which is run in the search path within cache implementations, behind this feature flag in case of any unexpected behavior.
With this PR, if PLUGGABLE_CACHE is true, cache implementations use the existing CacheStatsHolder class to keep track of their stats. If it's false, they instead use a DummyCacheStatsHolder, which keeps track of count only. In this case, the new cache stats API exposed in this PR will return all-zero stats and not support aggregating by any levels.
Because TieredSpilloverCache will store its own stats in #13236, NoopCacheStatsHolder will also be used in the individual tiers of the TieredSpilloverCache to avoid storing redundant stats.
Related Issues
Follow up to #12531.
Check List
- [N/A] Public documentation issue/PR createdBy 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.