thanos-io/thanos · error

mark for no compaction

Error message

mark %v for no compaction

What it means

During vertical compaction planning, marking a downsampled block (resolution > 0) as no-compact via block.MarkForNoCompact failed — typically a bucket write error — so the planner cannot guarantee the block stays out of vertical compaction.

Solutions

  1. Check the wrapped error for bucket connectivity/permissions.
  2. Retry the planning operation.
  3. Verify the object store allows writing marker objects for the block.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at pkg/compact/planner.go:284 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07). Data as JSON: /api/errors/82a498127407d95f. Report an issue: GitHub.

Appendix: source

Thrown at pkg/compact/planner.go:284

		}

		// If we have downsampled blocks, we need to mark them as no compact because it's impossible to do that with vertical compaction.
		// Technically, the resolution is part of the group key but do not attach ourselves to that level of detail.
		var marked = false
		for _, m := range plan {
			if m.Thanos.Downsample.Resolution == 0 {
				continue
			}
			if err := block.MarkForNoCompact(
				ctx,
				v.logger,
				v.bkt,
				m.ULID,
				metadata.DownsampleVerticalCompactionNoCompactReason,
				"verticalCompactionDownsampleFilter: Downsampled block, see https://github.com/thanos-io/thanos/issues/6775",
				v.markedForNoCompact,
			); err != nil {
				return nil, errors.Wrapf(err, "mark %v for no compaction", m.ULID.String())
			}
			noCompactMarked[m.ULID] = &metadata.NoCompactMark{ID: m.ULID, Version: metadata.NoCompactMarkVersion1}
			marked = true
		}

		if marked {
			continue PlanLoop
		}

		return plan, nil

	}
}

// WithLargeTotalIndexSizeFilter wraps Planner with largeTotalIndexSizeFilter that checks the given plans and estimates total index size.
// When found, it marks block for no compaction by placing no-compact-mark.json and updating cache.
// NOTE: The estimation is very rough as it assumes extreme cases of indexes sharing no bytes, thus summing all source index sizes.
// Adjust limit accordingly reducing to some % of actual limit you want to give.

View on GitHub (pinned to 35b8b99117)