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

Move TSC took-time policy to guard both heap and disk tier #17190

Merged
merged 21 commits into from
Feb 27, 2025

Conversation

peteralfonsi
Copy link
Contributor

Description

Changes the TieredSpilloverCache's minimum took-time policy so that queries must take >10 ms to enter either tier, instead of just to enter the disk tier. This is desirable because when we allow caching size > 0 queries in the request cache, the number of cacheable queries may go way up, and we should avoid flooding the heap tier with overly cheap queries.

Note the setting key tiered_spillover.disk.store.policies.took_time.threshold is unchanged, for backwards compatibility.

Related Issues

Resolves #16162

Check List

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

Signed-off-by: Peter Alfonsi <[email protected]>
@peteralfonsi peteralfonsi added backport PRs or issues specific to backporting features or enhancments and removed RFC Issues requesting major changes labels Jan 29, 2025
Signed-off-by: Peter Alfonsi <[email protected]>
Copy link
Contributor

✅ Gradle check result for 8ad8b7a: SUCCESS

Copy link
Contributor

❌ Gradle check result for d74ae2d: 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

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

@peteralfonsi
Copy link
Contributor Author

Flaky test: #17154

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

❌ Gradle check result for aee2d8e: 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

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

@peteralfonsi
Copy link
Contributor Author

Flaky test: #14559

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

✅ Gradle check result for b498909: SUCCESS

Copy link
Contributor

❌ Gradle check result for 128506d: 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

❌ Gradle check result for cb1bbf4:

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

✅ Gradle check result for a16a01f: SUCCESS

@jainankitk jainankitk merged commit b1e66b3 into opensearch-project:main Feb 27, 2025
31 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 27, 2025
* Move TSC took-time policy to guard both heap and disk tier

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

* changelog

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

* spotless apply

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

* Addressed Sagar's comment

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

* Add missing javadoc

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

* address round 2 of comments

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

* Add removal notification to put()

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

* Fix incorrect stats hit when cache entry rejected by policy

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

* rerun gradle

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

* Fixed more broken stats

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

* rerun gradle

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

* Addressed more comments

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

* make policy rejections count as neither hit or miss

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

* rerun gradle

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

* remove potential double-loading

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

* rerun gradle

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

* remove removalNotification

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

* rerun gradle

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 b1e66b3)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
jainankitk pushed a commit that referenced this pull request Feb 28, 2025
…17478)

* Move TSC took-time policy to guard both heap and disk tier



* changelog



* spotless apply



* Addressed Sagar's comment



* Add missing javadoc



* address round 2 of comments



* Add removal notification to put()



* Fix incorrect stats hit when cache entry rejected by policy



* rerun gradle



* Fixed more broken stats



* rerun gradle



* Addressed more comments



* make policy rejections count as neither hit or miss



* rerun gradle



* remove potential double-loading



* rerun gradle



* remove removalNotification



* rerun gradle



---------




(cherry picked from commit b1e66b3)

Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Peter Alfonsi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport PRs or issues specific to backporting features or enhancments backport 2.x Backport to 2.x branch enhancement Enhancement or improvement to existing feature or request RFC Issues requesting major changes Search:Performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC] Optimize caching policy for Request cache
3 participants