Store TSDB cant delete chunks from s3?

based on this comment nad information that only boltdb-shipper supports deleting logs i understand it as follows:


  • Indexes are deleted by compactor
  • Chunks needs to be deleted by TTL policy on S3
  • retention_stream: only deletes indexes but not chunks


  • Indexes are deleted by compactor
  • Chunks are deleted by Loki
  • retention_stream: deletes both indexes and chunks

Am i Correct?

PS: Reason why i ask is that i cant get retention policy working. Here is my (simplified for forum) configuration:

  retention_period: 720h
    - selector: '{app="myapp"}'
      priority: 1
      period: 24h
    - from: "2023-01-01"
        period: 24h
        prefix: loki_index_
      object_store: s3
      schema: v12
      store: tsdb
  working_directory: /srv/loki/boltdb-shipper-compactor
  shared_store: s3
  retention_enabled: true
  delete_request_cancel_period: 1h
  retention_delete_delay: 1h
    active_index_directory: /srv/loki/tsdb-index
    cache_location: /srv/loki/tsdb-index-cache
    shared_store: s3

I am pretty sure compactor still deletes chunks for TSDB. The difference between TSDB and boltdb from compactor’s standpoint is that compactor combines all boltdb index files from all ingesters into one table per file, but it doesn’t do it for TSDB. I read on a blog (can’t find the link at the moment) that TSDB is already optimized enough that doing the same merging / deduplication for TSDB doesn’t yield much performance gain.

Do you have any logs from compactor?

Chunks are beeing deleted as expected but there are few left undeleted probably from time when we switched from boltdb to TSDB. Closing.