Skip to content

Retention deletion does not work on S3 or GCS when a prefix is configured #3465

@bpfoster

Description

@bpfoster

Describe the bug
When object storage is configured to use AWS S3, and a prefix is configured, if retention is configured it does not appear to delete old data beyond the retention period.

To Reproduce
Steps to reproduce the behavior:

  1. Start Tempo v2.4.0
  2. Wait for blocklist_poll time to elapse.
  3. Wait for compacted_block_retention time to elapse.
  4. Wait a lot longer.
  5. Witness no files deleted from S3.

Expected behavior
I expect data files in S3 older than the configured block_retention to be deleted from S3.

Environment:

  • Infrastructure: Kubernetes
  • Deployment tool: helm

Additional Context
I see 0 blocks listed in the compactor logs:

level=debug ts=2024-03-05T17:03:31.370043415Z caller=s3.go:273 msg="listing blocks" keypath=foo/tempo/ found=1 IsTruncated=false NextMarker=
level=debug ts=2024-03-05T17:03:32.513352722Z caller=s3.go:389 msg="listing blocks complete" blockIDs=0 compactedBlockIDs=0

Notable configuration:

compactor:
  compaction:
    block_retention: 48h
    compacted_block_retention: 10m
storage:
  trace:
    backend: s3
    blocklist_poll: 1m
    s3:
      bucket: foobar-bucket
      prefix: foo/tempo

When I have no prefix configured, I see a lot of compaction/retention activity in the (debug) log. With a prefix configured, I see virtually nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions