Interview Prep/Monitoring & Observability/Long-Term Storage, Scale and Cost

The Thanos compactor has halted and the bucket keeps growing. What do you do?

AdvancedScenarioLong-Term Storage, Scale and Cost
Answer

Situation read → thanos_compact_halted == 1 usually means overlapping blocks (two uploaders with the same external labels) or a corrupted block. Without compaction, there is no downsampling or retention, and queries slow down.

What I'd do →

  1. Read the compactor logs for the block ULIDs and the reason (e.g. overlaps found while gathering blocks).
  2. Inspect the bucket:
    thanos tools bucket inspect --objstore.config-file=bucket.yml
    thanos tools bucket verify --objstore.config-file=bucket.yml --issues=overlapped_blocks
    
  3. Find the cause: two Prometheus replicas with identical external_labels (missing replica label), or a Receive/sidecar misconfiguration.
  4. Fix the labels, then mark the bad blocks for deletion or exclude them:
    thanos tools bucket mark --id=<ULID> --marker=deletion-mark.json --details="overlap fix" --objstore.config-file=bucket.yml
    
  5. Restart the compactor and alert on thanos_compact_halted going forward.

Why → The compactor halts on purpose to avoid making data corruption worse.

Interview tip → Mention that exactly one compactor per bucket is a hard rule.

All Monitoring & Observability questions

More on Long-Term Storage, Scale and Cost