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

[Tiered caching] Introducing cache plugins and exposing Ehcache as one of the pluggable disk cache option #11874

Merged
merged 25 commits into from Mar 1, 2024

Conversation

sgup432
Copy link
Contributor

@sgup432 sgup432 commented Jan 12, 2024

Description

Integrating ehcache as a disk cache option which is needed as part of tiered caching. Exposing it as a plugin.
Ehcache Details:

  • Disk based cache uses LFU and it is not configurable
  • Disk writes are performed asynchronously using separate thread pool.
  • Supports cache event listeners.

This change also includes refactoring existing interfaces and moving tieredCache to a module.

Using below settings, anyone can set desired cache:

indices.request.cache.store.name: opensearch_onheap
indices.request.cache.opensearch_onheap.size: 100kb
indices.request.cache.store.name: ehcache_disk
indices.request.cache.ehcache_disk.max_size_in_bytes: 1000
indices.request.cache.store.name: tiered_spillover
indices.request.cache.tiered_spillover.onheap.store.name: opensearch_onheap
indices.request.cache.tiered_spillover.disk.store.name: ehcache_disk
indices.request.cache.opensearch.size: 100kb
indices.request.cache.ehcache_disk.max_size_in_bytes: 1000

Testing

  • Added appropriate unit tests.
  • We have been POC/performance testing with ehcache. Will be doing another round.

Related Issues

Resolves #11897
and #12296

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)
  • 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.

Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
@sgup432
Copy link
Contributor Author

sgup432 commented Jan 12, 2024

@sohami @Bukhtawar

@sgup432 sgup432 changed the title [Tiered caching] Integrating ehcache disk cache [Tiered caching] Integrating ehcache as a disk cache option Jan 12, 2024
Copy link
Contributor

❌ Gradle check result for 3afcb42: 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: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
Copy link
Contributor

github-actions bot commented Mar 1, 2024

❌ Gradle check result for f850b4d: 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 Mar 1, 2024

❌ Gradle check result for e6ae90e: 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 Mar 1, 2024

❌ Gradle check result for e6ae90e: 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 Mar 1, 2024

❌ Gradle check result for e6ae90e: 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: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
Copy link
Contributor

github-actions bot commented Mar 1, 2024

❌ Gradle check result for e902526: 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: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
Copy link
Contributor

github-actions bot commented Mar 1, 2024

❌ Gradle check result for b866ed2: 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: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
Copy link
Contributor

github-actions bot commented Mar 1, 2024

✅ Gradle check result for 081e269: SUCCESS

Copy link

codecov bot commented Mar 1, 2024

Codecov Report

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

Project coverage is 71.39%. Comparing base (7921175) to head (081e269).
Report is 1 commits behind head on main.

Files Patch % Lines
.../opensearch/cache/store/disk/EhcacheDiskCache.java 75.00% 38 Missing and 9 partials ⚠️
...search/cache/common/tier/TieredSpilloverCache.java 92.23% 7 Missing and 1 partial ⚠️
.../java/org/opensearch/cache/EhcacheCachePlugin.java 20.00% 8 Missing ⚠️
.../cache/common/tier/TieredSpilloverCachePlugin.java 30.00% 7 Missing ⚠️
...org/opensearch/cache/EhcacheDiskCacheSettings.java 90.90% 2 Missing and 1 partial ⚠️
.../store/settings/OpenSearchOnHeapCacheSettings.java 82.35% 2 Missing and 1 partial ⚠️
.../opensearch/common/cache/service/CacheService.java 88.23% 1 Missing and 1 partial ⚠️
...arch/common/cache/store/OpenSearchOnHeapCache.java 83.33% 2 Missing ⚠️
...n/java/org/opensearch/common/settings/Setting.java 75.00% 1 Missing and 1 partial ⚠️
...ache/common/tier/TieredSpilloverCacheSettings.java 80.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11874      +/-   ##
============================================
+ Coverage     71.37%   71.39%   +0.01%     
- Complexity    59891    59904      +13     
============================================
  Files          4972     4980       +8     
  Lines        281783   282131     +348     
  Branches      40910    40937      +27     
============================================
+ Hits         201136   201434     +298     
- Misses        63977    64008      +31     
- Partials      16670    16689      +19     

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

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sgup432 Great work - thanks for the investment in this space!

@peternied peternied changed the title [Tiered caching] Integrating ehcache as a disk cache option [Tiered caching] Introducing cache plugins and exposing Ehcache as one of the pluggable disk cache option Mar 1, 2024
@peternied peternied merged commit 57f6f46 into opensearch-project:main Mar 1, 2024
35 checks passed
@msfroh msfroh added the backport 2.x Backport to 2.x branch label Mar 1, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 1, 2024
…e of the pluggable disk cache option (#11874)

Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
Signed-off-by: Sagar <99425694+sgup432@users.noreply.github.com>
(cherry picked from commit 57f6f46)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
sgup432 added a commit to sgup432/OpenSearch that referenced this pull request Mar 2, 2024
…e of the pluggable disk cache option (opensearch-project#11874)

Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
Signed-off-by: Sagar <99425694+sgup432@users.noreply.github.com>
ltaragi pushed a commit to ltaragi/OpenSearch that referenced this pull request Mar 4, 2024
…e of the pluggable disk cache option (opensearch-project#11874)

Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
Signed-off-by: Sagar <99425694+sgup432@users.noreply.github.com>
amkhar pushed a commit to amkhar/OpenSearch that referenced this pull request Mar 12, 2024
…e of the pluggable disk cache option (opensearch-project#11874)

Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
Signed-off-by: Sagar <99425694+sgup432@users.noreply.github.com>
Signed-off-by: Aman Khare <amkhar@amazon.com>
amkhar pushed a commit to amkhar/OpenSearch that referenced this pull request Mar 14, 2024
…e of the pluggable disk cache option (opensearch-project#11874)

Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
Signed-off-by: Sagar <99425694+sgup432@users.noreply.github.com>
rayshrey pushed a commit to rayshrey/OpenSearch that referenced this pull request Mar 18, 2024
…e of the pluggable disk cache option (opensearch-project#11874)

Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
Signed-off-by: Sagar <99425694+sgup432@users.noreply.github.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…e of the pluggable disk cache option (opensearch-project#11874)

Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
Signed-off-by: Sagar <99425694+sgup432@users.noreply.github.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
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 enhancement Enhancement or improvement to existing feature or request Search:Performance v2.13.0 Issues and PRs related to version 2.13.0
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Tiered Caching][Milestone 1] Integrate disk cache
5 participants