diff --git a/pkg/compact/compact.go b/pkg/compact/compact.go index ad5c92bdb9..b93999bc47 100644 --- a/pkg/compact/compact.go +++ b/pkg/compact/compact.go @@ -807,14 +807,17 @@ type CompactionLifecycleCallback interface { type DefaultCompactionLifecycleCallback struct { } -func (c DefaultCompactionLifecycleCallback) PreCompactionCallback(_ context.Context, _ log.Logger, _ *Group, toCompactBlocks []*metadata.Meta) error { +func (c DefaultCompactionLifecycleCallback) PreCompactionCallback(_ context.Context, logger log.Logger, cg *Group, toCompactBlocks []*metadata.Meta) error { // Due to #183 we verify that none of the blocks in the plan have overlapping sources. // This is one potential source of how we could end up with duplicated chunks. uniqueSources := map[ulid.ULID]struct{}{} for _, m := range toCompactBlocks { for _, s := range m.Compaction.Sources { if _, ok := uniqueSources[s]; ok { - return halt(errors.Errorf("overlapping sources detected for plan %v", toCompactBlocks)) + if !cg.enableVerticalCompaction { + return halt(errors.Errorf("overlapping sources detected for plan %v", toCompactBlocks)) + } + level.Warn(logger).Log("msg", "overlapping sources detected for plan", "duplicated_block", s, "to_compact_blocks", fmt.Sprintf("%v", toCompactBlocks)) } uniqueSources[s] = struct{}{} }