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 →
- Read the compactor logs for the block ULIDs and the reason (e.g.
overlaps found while gathering blocks). - Inspect the bucket:
thanos tools bucket inspect --objstore.config-file=bucket.yml thanos tools bucket verify --objstore.config-file=bucket.yml --issues=overlapped_blocks - Find the cause: two Prometheus replicas with identical
external_labels(missingreplicalabel), or a Receive/sidecar misconfiguration. - 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 - Restart the compactor and alert on
thanos_compact_haltedgoing 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.
More on Long-Term Storage, Scale and Cost
Prometheus keeps 15 days of data, but leadership wants 13 months of metrics for capacity planning. What do you build?IntermediateGrafana shows every series twice after you added a second Prometheus replica with Thanos. How do you fix it?IntermediateRemote write to your central store is falling further behind every hour. How do you handle it?AdvancedMimir rejects writes from a team with `err-mimir-max-series-per-user`. What do you do?IntermediateYour observability SaaS bill tripled in a quarter, driven by custom metrics. How do you bring it down?IntermediateYou must choose between Thanos and Mimir for a new long-term metrics platform. How do you decide?Advanced