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

[Bugfix] Fix TieredSpilloverCache stats not adding correctly when shards are closed #16560

Merged
merged 15 commits into from
Nov 22, 2024

Conversation

peteralfonsi
Copy link
Contributor

@peteralfonsi peteralfonsi commented Nov 4, 2024

Description

Fixes a bug where the total stats for the TieredSpilloverCache are decremented incorrectly when shards were closed. Misses and evictions from both the heap and disk tier were subtracted from the total, but this is incorrect. When the disk tier is enabled, only disk-tier misses and evictions should count towards the cache total, so only they should be subtracted. Adds UTs and ITs around this.

Also adds UT coverage for TieredSpilloverCacheStatsHolder, which was missing before.

Related Issues

Resolves #16559

Check List

  • Functionality includes testing.
  • [N/A] API changes companion pull request created, if applicable.
  • [N/A] 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.

Peter Alfonsi added 7 commits October 24, 2024 16:19
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Copy link
Contributor

github-actions bot commented Nov 4, 2024

❌ Gradle check result for c2a05d4: 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: Peter Alfonsi <[email protected]>
Copy link
Contributor

github-actions bot commented Nov 5, 2024

❌ Gradle check result for f85b719: 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 Nov 5, 2024

❌ Gradle check result for a39d586: 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: Peter Alfonsi <[email protected]>
Copy link
Contributor

github-actions bot commented Nov 5, 2024

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

Peter Alfonsi and others added 2 commits November 5, 2024 12:49
Copy link
Contributor

github-actions bot commented Nov 5, 2024

❕ Gradle check result for dbd0947: 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.

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 72.18%. Comparing base (b1a7743) to head (2e8ffee).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...search/cache/common/tier/TieredSpilloverCache.java 75.00% 0 Missing and 1 partial ⚠️
...e/common/tier/TieredSpilloverCacheStatsHolder.java 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #16560      +/-   ##
============================================
+ Coverage     72.16%   72.18%   +0.02%     
+ Complexity    65246    65225      -21     
============================================
  Files          5318     5318              
  Lines        303940   303945       +5     
  Branches      43976    43976              
============================================
+ Hits         219326   219412      +86     
+ Misses        66625    66520     -105     
- Partials      17989    18013      +24     

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


🚨 Try these New Features:

Copy link
Contributor

❌ Gradle check result for 0de6284:

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

✅ Gradle check result for 2e8ffee: SUCCESS

@andrross andrross added the backport 2.x Backport to 2.x branch label Nov 22, 2024
@andrross andrross merged commit c82cd2e into opensearch-project:main Nov 22, 2024
40 of 42 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 22, 2024
…rds are closed (#16560)

* added draft tests for tsc stats holder

Signed-off-by: Peter Alfonsi <[email protected]>

* first draft tsc stats bugfix

Signed-off-by: Peter Alfonsi <[email protected]>

* Complete tests

Signed-off-by: Peter Alfonsi <[email protected]>

* Cleanup

Signed-off-by: Peter Alfonsi <[email protected]>

* Integrate fix with TSC

Signed-off-by: Peter Alfonsi <[email protected]>

* Add IT

Signed-off-by: Peter Alfonsi <[email protected]>

* Refactor cache package names in TSC module to match with server

Signed-off-by: Peter Alfonsi <[email protected]>

* changelog

Signed-off-by: Peter Alfonsi <[email protected]>

* Revert "Refactor cache package names in TSC module to match with server"

This reverts commit 3b15a7a.

Signed-off-by: Peter Alfonsi <[email protected]>

* Addressed Sagar's comments

Signed-off-by: Peter Alfonsi <[email protected]>

* More package fixes

Signed-off-by: Peter Alfonsi <[email protected]>

* Addressed andross's comments

Signed-off-by: Peter Alfonsi <[email protected]>

---------

Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Co-authored-by: Peter Alfonsi <[email protected]>
(cherry picked from commit c82cd2e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
peteralfonsi added a commit to peteralfonsi/OpenSearch that referenced this pull request Dec 5, 2024
…rds are closed (opensearch-project#16560)

* added draft tests for tsc stats holder

Signed-off-by: Peter Alfonsi <[email protected]>

* first draft tsc stats bugfix

Signed-off-by: Peter Alfonsi <[email protected]>

* Complete tests

Signed-off-by: Peter Alfonsi <[email protected]>

* Cleanup

Signed-off-by: Peter Alfonsi <[email protected]>

* Integrate fix with TSC

Signed-off-by: Peter Alfonsi <[email protected]>

* Add IT

Signed-off-by: Peter Alfonsi <[email protected]>

* Refactor cache package names in TSC module to match with server

Signed-off-by: Peter Alfonsi <[email protected]>

* changelog

Signed-off-by: Peter Alfonsi <[email protected]>

* Revert "Refactor cache package names in TSC module to match with server"

This reverts commit 3b15a7a.

Signed-off-by: Peter Alfonsi <[email protected]>

* Addressed Sagar's comments

Signed-off-by: Peter Alfonsi <[email protected]>

* More package fixes

Signed-off-by: Peter Alfonsi <[email protected]>

* Addressed andross's comments

Signed-off-by: Peter Alfonsi <[email protected]>

---------

Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Co-authored-by: Peter Alfonsi <[email protected]>
(cherry picked from commit c82cd2e)
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 bug Something isn't working Search Search query, autocomplete ...etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Stats for tiered spillover cache are wrong in some situations
3 participants