{"record":{"id":"05e2c62d5a2f0b50","repo":"thanos-io/thanos","slug":"resulted-compacted-block-s-overlaps-with-somethin","errorCode":null,"errorMessage":"resulted compacted block %s overlaps with something","messagePattern":"resulted compacted block (.+?) overlaps with something","errorType":"exception","errorClass":"halt","httpStatus":null,"severity":"error","filePath":"pkg/compact/compact.go","lineNumber":1348,"sourceCode":"\t\t\tSource:       metadata.CompactorSource,\n\t\t\tSegmentFiles: block.GetSegmentFiles(bdir),\n\t\t\tExtensions:   cg.Extensions(),\n\t\t}\n\t\tif stats.ChunkMaxSize > 0 {\n\t\t\tthanosMeta.IndexStats.ChunkMaxSize = stats.ChunkMaxSize\n\t\t}\n\t\tif stats.SeriesMaxSize > 0 {\n\t\t\tthanosMeta.IndexStats.SeriesMaxSize = stats.SeriesMaxSize\n\t\t}\n\t\tnewMeta, err = metadata.InjectThanos(cg.logger, bdir, thanosMeta, nil)\n\t\tif err != nil {\n\t\t\treturn false, nil, errors.Wrapf(err, \"failed to finalize the block %s\", bdir)\n\t\t}\n\t\t// Ensure the output block is not overlapping with anything else,\n\t\t// unless vertical compaction is enabled.\n\t\tif !cg.enableVerticalCompaction {\n\t\t\tif err := cg.areBlocksOverlapping(newMeta, toCompact...); err != nil {\n\t\t\t\treturn false, nil, halt(errors.Wrapf(err, \"resulted compacted block %s overlaps with something\", bdir))\n\t\t\t}\n\t\t}\n\n\t\tbegin = time.Now()\n\n\t\terr = tracing.DoInSpanWithErr(ctx, \"compaction_block_upload\", func(ctx context.Context) error {\n\t\t\treturn block.Upload(ctx, cg.logger, cg.bkt, bdir, cg.hashFunc, objstore.WithUploadConcurrency(cg.blockFilesConcurrency))\n\t\t})\n\t\tif err != nil {\n\t\t\treturn false, nil, retry(errors.Wrapf(err, \"upload of %s failed\", compID))\n\t\t}\n\t\tlevel.Info(cg.logger).Log(\"msg\", \"uploaded block\", \"result_block\", compID, \"duration\", time.Since(begin), \"duration_ms\", time.Since(begin).Milliseconds())\n\t\tlevel.Info(cg.logger).Log(\"msg\", \"running post compaction callback\", \"result_block\", compID)\n\t\tif err := compactionLifecycleCallback.PostCompactionCallback(ctx, cg.logger, cg, compID); err != nil {\n\t\t\treturn false, nil, retry(errors.Wrapf(err, \"failed to run post compaction callback for result block %s\", compID))\n\t\t}\n\t\tlevel.Info(cg.logger).Log(\"msg\", \"finished running post compaction callback\", \"result_block\", compID)\n\t}","sourceCodeStart":1330,"sourceCodeEnd":1366,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/compact/compact.go#L1330-L1366","documentation":"Post-compaction overlap check found the newly compacted block overlaps existing blocks while vertical compaction is disabled. Wrapped in halt() — the compactor stops to prevent data duplication/inconsistency.","triggerScenarios":"Thrown at pkg/compact/compact.go:1348 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Investigate overlapping source blocks (remove duplicates from bucket)","Enable vertical compaction deliberately if overlap is expected","Check for multiple compactors running concurrently"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}