thanos-io/thanos · error

non-sequential chunks not equal

Error message

non-sequential chunks not equal: [%d, %d] and [%d, %d]

What it means

IgnoreDuplicateOutsideChunk guard: overlapping chunks have different min/max time ranges, so they cannot be proven duplicates and it is unsafe to drop one. Inputs at fault: corrupt/duplicated blocks with non-identical overlapping chunks.

Solutions

  1. Investigate the source of duplicated but differing chunks
  2. Use vertical compaction instead of dedup repair
  3. Do not force-drop; data would be lost
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/block/index.go:516 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/9aa294138854f365. Report an issue: GitHub.

Appendix: source

Thrown at pkg/block/index.go:516

		// "Near" outsider from issue https://github.com/prometheus/tsdb/issues/347. Ignore.
		return true, nil
	}
	return false, nil
}

func IgnoreDuplicateOutsideChunk(_, _ int64, last, curr *chunks.Meta) (bool, error) {
	if last == nil {
		return false, nil
	}

	if curr.MinTime > last.MaxTime {
		return false, nil
	}

	// Verify that the overlapping chunks are exact copies so we can safely discard
	// the current one.
	if curr.MinTime != last.MinTime || curr.MaxTime != last.MaxTime {
		return false, errors.Errorf("non-sequential chunks not equal: [%d, %d] and [%d, %d]",
			last.MinTime, last.MaxTime, curr.MinTime, curr.MaxTime)
	}
	ca := crc32.Checksum(last.Chunk.Bytes(), castagnoli)
	cb := crc32.Checksum(curr.Chunk.Bytes(), castagnoli)

	if ca != cb {
		return false, errors.Errorf("non-sequential chunks not equal: %x and %x", ca, cb)
	}

	return true, nil
}

// sanitizeChunkSequence ensures order of the input chunks and drops any duplicates.
// It errors if the sequence contains non-dedupable overlaps.
func sanitizeChunkSequence(chks []chunks.Meta, mint, maxt int64, ignoreChkFns []ignoreFnType) ([]chunks.Meta, error) {
	if len(chks) == 0 {
		return nil, nil
	}

View on GitHub (pinned to 35b8b99117)