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] Indices Request cache stalekey management (#12625) #12707

Merged

Conversation

kiranprakash154
Copy link
Contributor

@kiranprakash154 kiranprakash154 commented Mar 17, 2024

Description

Backports #12625

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.

…h-project#12625)

* Introduce IndicesRequestCacheCleanupManager

Signed-off-by: Kiran Prakash <[email protected]>

* using cleanup mgr to enqueue cleanups

Signed-off-by: Kiran Prakash <[email protected]>

* readability improvements

Signed-off-by: Kiran Prakash <[email protected]>

* update updateCleanupKeyToCountMap on new cache entry

Signed-off-by: Kiran Prakash <[email protected]>

* create IndicesRequestCacheCleanupManager & settings and validators

Signed-off-by: Kiran Prakash <[email protected]>

* Add IRC specific cache cleaner and remove from IndicesService

Signed-off-by: Kiran Prakash <[email protected]>

* Unit Tests

Signed-off-by: Kiran Prakash <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Kiran Prakash <[email protected]>

* move cachecleaner inside mgr

Signed-off-by: Kiran Prakash <[email protected]>

* remove processCleanupKeys

Signed-off-by: Kiran Prakash <[email protected]>

* minor cleanups

Signed-off-by: Kiran Prakash <[email protected]>

* add updateCleanupKeyToCountMapOnCacheEviction

Signed-off-by: Kiran Prakash <[email protected]>

* remove locks and make all methods synchronized

Signed-off-by: Kiran Prakash <[email protected]>

* spotless

Signed-off-by: Kiran Prakash <[email protected]>

* updateCleanupKeyToCountMapOnCacheEviction

Signed-off-by: Kiran Prakash <[email protected]>

* Testing

Signed-off-by: Kiran Prakash <[email protected]>

* add Reschedule back to indices service

Signed-off-by: Kiran Prakash <[email protected]>

* rename updateStaleKeysCount to incrementStaleKeysCount

Signed-off-by: Kiran Prakash <[email protected]>

* rename getStaleKeysCountForTesting to getStaleKeysCount

Signed-off-by: Kiran Prakash <[email protected]>

* rename threshold to stalenessThreshold

Signed-off-by: Kiran Prakash <[email protected]>

* check for cleanupKey.entity == null

Signed-off-by: Kiran Prakash <[email protected]>

* use computeIfPresent with keycountmap

Signed-off-by: Kiran Prakash <[email protected]>

* log both staleKeysInCache & Staleness in debug logs

Signed-off-by: Kiran Prakash <[email protected]>

* Use HashMap instead of ConcurrentMap

Signed-off-by: Kiran Prakash <[email protected]>

* Address b/w compatibility

Signed-off-by: Kiran Prakash <[email protected]>

* remove synchronized for updateCleanupKeyToCountMapOnCacheEviction

Signed-off-by: Kiran Prakash <[email protected]>

* make cleanCache synchronized

Signed-off-by: Kiran Prakash <[email protected]>

* remove shouldRemoveKey

Signed-off-by: Kiran Prakash <[email protected]>

* spotlessApply

Signed-off-by: Kiran Prakash <[email protected]>

---------

Signed-off-by: Kiran Prakash <[email protected]>
(cherry picked from commit b4da802)
@kiranprakash154 kiranprakash154 changed the title [Tiered Caching] Indices Request cache stalekey management (#12625) [Backport-2.x][Tiered Caching] Indices Request cache stalekey management (#12625) Mar 17, 2024
Copy link
Contributor

github-actions bot commented Mar 17, 2024

Compatibility status:

Checks if related components are compatible with change ca503bc

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/flow-framework.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/sql.git]

Copy link
Contributor

❌ Gradle check result for 6697fec: 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 4e937ca: 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 4e937ca: null

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?

@kiranprakash154
Copy link
Contributor Author

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

This was due to flaky test that has issue created - #10704

@kiranprakash154
Copy link
Contributor Author

❌ Gradle check result for 4e937ca: null

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?

This was due to flaky test that has issue created - #12236

CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: Kiran Prakash <[email protected]>
Copy link
Contributor

❌ Gradle check result for 9d4f011:

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: Kiran Prakash <[email protected]>
Signed-off-by: Kiran Prakash <[email protected]>
Copy link
Contributor

❌ Gradle check result for ca503bc:

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 9708f79:

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 9708f79: SUCCESS

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

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

Project coverage is 71.22%. Comparing base (0dd892c) to head (9708f79).
Report is 37 commits behind head on 2.x.

Files Patch % Lines
...va/org/opensearch/indices/IndicesRequestCache.java 80.30% 14 Missing and 12 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x   #12707      +/-   ##
============================================
- Coverage     71.28%   71.22%   -0.07%     
- Complexity    60145    60173      +28     
============================================
  Files          4957     4963       +6     
  Lines        282799   283268     +469     
  Branches      41409    41466      +57     
============================================
+ Hits         201591   201752     +161     
- Misses        64189    64427     +238     
- Partials      17019    17089      +70     

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

@sohami sohami merged commit e1403a2 into opensearch-project:2.x Mar 19, 2024
30 checks passed
@kiranprakash154 kiranprakash154 deleted the backport/backport-12625-to-2.x branch March 22, 2024 19:50
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.

3 participants