kafka icon indicating copy to clipboard operation
kafka copied to clipboard

KAFKA-19970: Add configurable TTL for tiered storage index cache eviction

Open nandini12396 opened this issue 1 month ago • 1 comments

Caffeine cache currently only uses size-based eviction with frequency buckets. Within same frequency bucket, larger entries are always evicted. This causes old (smaller) index files to stay in cache indefinitely while newer indices thrash, resulting in:

  • Poor cache utilization for backfill workloads
  • Higher fetch errors
  • Suboptimal memory usage

Solution:

Add time-based eviction via expireAfterAccess in addition to size-based eviction:

  1. New config: remote.log.index.file.cache.ttl.ms (default: -1/disabled)
  2. If TTL > 0: entries evicted after last access time expires

nandini12396 avatar Dec 05 '25 13:12 nandini12396

@nandini12396 , adding new config (public API) needs to go through the KIP process: https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Improvement+Proposals.

showuon avatar Dec 10 '25 06:12 showuon

A label of 'needs-attention' was automatically added to this PR in order to raise the attention of the committers. Once this issue has been triaged, the triage label should be removed to prevent this automation from happening again.

github-actions[bot] avatar Dec 13 '25 03:12 github-actions[bot]

Nice find! Thanks for the patch, adding new configs require KIP to proceed.

kamalcph avatar Dec 16 '25 06:12 kamalcph

@showuon Since this qualify as a bug, shall we go-ahead with internal config? And, open a KIP in-parallel to expose the config to users. WDYT?

kamalcph avatar Dec 17 '25 10:12 kamalcph