cortex icon indicating copy to clipboard operation
cortex copied to clipboard

Add a configuration for an index cache ttl

Open SungJin1212 opened this issue 1 year ago • 3 comments

Add a configuration for an index cache ttl. The index cache ttl can be configured by -blocks-storage.bucket-store.index-cache.redis.index-ttl and -blocks-storage.bucket-store.index-cache.memcached.index-ttl

Which issue(s) this PR fixes: Fixes #

Checklist

  • [ ] Tests updated
  • [ ] Documentation added
  • [x] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

SungJin1212 avatar Sep 25 '24 07:09 SungJin1212

@yeya24 I agree with your thoughts. Different TTLs are necessary to consider block range. There is a necessary to set of different TTL based on block meta's MaxTime and MinTime. But, the cache interface is dependent on the thanos. I think if the TTL parameter is added to StorePostings, StoreExpandedPostings, and StoreSeries funcs, the implementation is possible. c.f. https://github.com/thanos-io/thanos/blob/main/pkg/store/cache/cache.go#L43

SungJin1212 avatar Sep 26 '24 04:09 SungJin1212

@SungJin1212 Agree. I think it would be useful to extend the interface to support TTL. The TTL could be a function that takes block metadata info as a parameter so that we know we use longer TTL for L4 blocks.

yeya24 avatar Sep 26 '24 05:09 yeya24

@yeya24 Yes. If then, more optimization can be done.

SungJin1212 avatar Sep 26 '24 05:09 SungJin1212

Hello @SungJin1212, thank you for opening this PR.

There is a release in progress. As such, please rebase your CHANGELOG entry on top of the master branch and move the CHANGELOG entry to the top under ## master / unreleased.

Thanks, Charlie

CharlieTLe avatar Jan 23 '25 03:01 CharlieTLe

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 26 '25 17:04 stale[bot]