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

[Backport 2.x] [Tiered Caching] Stats rework (2/4): Gates CacheStatsHolder logic behind FeatureFlags.PLUGGABLE_CACHE setting #13432

Merged

Conversation

peteralfonsi
Copy link
Contributor

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

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
    - [N/A] Public documentation issue/PR created

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.

…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)
Copy link
Contributor

❕ Gradle check result for d730b30: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT.test {p0=indices.get_field_mapping/20_missing_field/Return empty object if field doesn't exist, but index does}

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

Copy link

codecov bot commented Apr 28, 2024

Codecov Report

Attention: Patch coverage is 95.38462% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 71.12%. Comparing base (0dd892c) to head (d730b30).
Report is 201 commits behind head on 2.x.

Files Patch % Lines
...ch/common/cache/stats/DefaultCacheStatsHolder.java 95.32% 1 Missing and 4 partials ⚠️
...earch/common/cache/stats/NoopCacheStatsHolder.java 93.75% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@peteralfonsi
Copy link
Contributor Author

@msfroh @dblock @andrross @reta Would anybody be able to approve this backport PR? There are no changes compared to the original PR.

@VachaShah VachaShah merged commit a30d7b2 into opensearch-project:2.x Apr 29, 2024
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants