Skip to content

Commit

Permalink
[Tiered Caching] Indices Request cache stalekey management (opensearc…
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
kiranprakash154 committed Mar 17, 2024
1 parent 5c5be46 commit 6697fec
Show file tree
Hide file tree
Showing 4 changed files with 800 additions and 66 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Remote reindex: Add support for configurable retry mechanism ([#12561](https://github.com/opensearch-project/OpenSearch/pull/12561))
- Tracing for deep search path ([#12103](https://github.com/opensearch-project/OpenSearch/pull/12103))
- [Metrics Framework] Adds support for asynchronous gauge metric type. ([#12642](https://github.com/opensearch-project/OpenSearch/issues/12642))
- [Tiered caching] Add Stale keys Management and CacheCleaner to IndicesRequestCache ([#12625](https://github.com/opensearch-project/OpenSearch/pull/12625))

### Dependencies
- Bump `com.squareup.okio:okio` from 3.7.0 to 3.8.0 ([#12290](https://github.com/opensearch-project/OpenSearch/pull/12290))
Expand Down Expand Up @@ -65,7 +66,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fix get task API does not refresh resource stats ([#11531](https://github.com/opensearch-project/OpenSearch/pull/11531))
- Fix for deserilization bug in weighted round-robin metadata ([#11679](https://github.com/opensearch-project/OpenSearch/pull/11679))
- onShardResult and onShardFailure are executed on one shard causes opensearch jvm crashed ([#12158](https://github.com/opensearch-project/OpenSearch/pull/12158))
- Avoid overflow when sorting missing last on `epoch_millis` datetime field ([#12676](https://github.com/opensearch-project/OpenSearch/pull/12676))

### Security

Expand Down
Loading

0 comments on commit 6697fec

Please sign in to comment.