{"record":{"id":"3b193020cac9d9fc","repo":"thanos-io/thanos","slug":"id-matching-is-not-supported","errorCode":null,"errorMessage":"id matching is not supported","messagePattern":"id matching is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/verifier/duplicated_compaction.go","lineNumber":29,"sourceCode":"\t\"github.com/go-kit/log/level\"\n\t\"github.com/oklog/ulid/v2\"\n\n\t\"github.com/pkg/errors\"\n\t\"github.com/prometheus/prometheus/tsdb\"\n)\n\n// DuplicatedCompactionBlocks is for bug fixed in https://github.com/thanos-io/thanos/commit/94e26c63e52ba45b713fd998638d0e7b2492664f.\n// Bug resulted in source block not being removed immediately after compaction, so we were compacting again and again same sources\n// until sync-delay passes.\n// The expected print of this are same overlapped blocks with exactly the same sources, time ranges and stats.\n// If repair is enabled, all but one duplicates are safely deleted.\ntype DuplicatedCompactionBlocks struct{}\n\nfunc (DuplicatedCompactionBlocks) IssueID() string { return \"duplicated_compaction\" }\n\nfunc (DuplicatedCompactionBlocks) VerifyRepair(ctx Context, idMatcher func(ulid.ULID) bool, repair bool) error {\n\tif idMatcher != nil {\n\t\treturn errors.Errorf(\"id matching is not supported\")\n\t}\n\n\tlevel.Info(ctx.Logger).Log(\"msg\", \"started verifying issue\", \"with-repair\", repair)\n\n\toverlaps, err := fetchOverlaps(ctx, ctx.Fetcher)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"fetch overlaps\")\n\t}\n\n\tif len(overlaps) == 0 {\n\t\t// All good.\n\t\treturn nil\n\t}\n\n\t// We have overlaps, let's see if they include exact duplicates. If yes, let's put them into distinct set.\n\tvar (\n\t\ttoKillLookup = map[ulid.ULID]struct{}{}\n\t\ttoKill       []ulid.ULID","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/verifier/duplicated_compaction.go#L11-L47","documentation":"The DuplicatedCompactionBlocks verifier in pkg/verifier supports only whole-block ID-based repair workflows; its VerifyRepair returns this error whenever a non-nil idMatcher is supplied. ID matching (repairing only blocks whose ULID matches a predicate) is explicitly unsupported for the duplicated_compaction issue because repairs must process overlapping block groups together.","triggerScenarios":"Running the verifier (e.g. `thanos tools bucket verify --id-matching` style invocation or API call passing an idMatcher func) against issue 'duplicated_compaction'.","commonSituations":"Operators reusing a generic verify command with the id-matching flag for all issue types; duplicated compaction is one of the few issues that cannot be filtered that way.","solutions":["Re-run the verification without the id-matching option for the duplicated_compaction issue","Use block-id based verification for other issues if selective repair is needed","If selective repair of duplicates is required, handle overlapping groups manually with compaction tooling"],"exampleFix":"// before\nthanos tools bucket verify --issue duplicated_compaction --id-matching\n// after\nthanos tools bucket verify --issue duplicated_compaction","handlingStrategy":"fallback","validationCode":"// Only pass idMatcher for issues that support it\nif issue == \"duplicated_compaction\" && idMatcher != nil {\n    return fmt.Errorf(\"run duplicated_compaction verification without id matching\")\n}","typeGuard":null,"tryCatchPattern":"if err := verifier.VerifyRepair(ctx, matcher, repair); err != nil {\n    if strings.Contains(err.Error(), \"id matching is not supported\") {\n        // retry without matcher\n        return verifier.VerifyRepair(ctx, nil, repair)\n    }\n    return err\n}","preventionTips":["Do not pass --id-matching style options when verifying duplicated_compaction","Know which issue types support selective ID matching before scripting verification","Handle overlapping block groups as a unit rather than per-ID"],"tags":["verifier","thanos","compaction","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}