Add a configuration for an index cache ttl
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.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]
@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 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 Yes. If then, more optimization can be done.
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
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.