Skip to content

Commit b7a58dc

Browse files
authored
Add hidden flag to disable overlapping compaction (#14581)
TSDB: add hidden flag to disable overlapping compaction Signed-off-by: Ben Ye <[email protected]> --------- Signed-off-by: Ben Ye <[email protected]>
1 parent 27579c9 commit b7a58dc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cmd/prometheus/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ func main() {
384384
serverOnlyFlag(a, "storage.tsdb.allow-overlapping-blocks", "[DEPRECATED] This flag has no effect. Overlapping blocks are enabled by default now.").
385385
Default("true").Hidden().BoolVar(&b)
386386

387+
serverOnlyFlag(a, "storage.tsdb.allow-overlapping-compaction", "Allow compaction of overlapping blocks. If set to false, TSDB stops vertical compaction and leaves overlapping blocks there. The use case is to let another component handle the compaction of overlapping blocks.").
388+
Default("true").Hidden().BoolVar(&cfg.tsdb.EnableOverlappingCompaction)
389+
387390
serverOnlyFlag(a, "storage.tsdb.wal-compression", "Compress the tsdb WAL.").
388391
Hidden().Default("true").BoolVar(&cfg.tsdb.WALCompression)
389392

@@ -1719,6 +1722,7 @@ type tsdbOptions struct {
17191722
EnableMemorySnapshotOnShutdown bool
17201723
EnableNativeHistograms bool
17211724
EnableDelayedCompaction bool
1725+
EnableOverlappingCompaction bool
17221726
}
17231727

17241728
func (opts tsdbOptions) ToTSDBOptions() tsdb.Options {
@@ -1739,8 +1743,8 @@ func (opts tsdbOptions) ToTSDBOptions() tsdb.Options {
17391743
EnableMemorySnapshotOnShutdown: opts.EnableMemorySnapshotOnShutdown,
17401744
EnableNativeHistograms: opts.EnableNativeHistograms,
17411745
OutOfOrderTimeWindow: opts.OutOfOrderTimeWindow,
1742-
EnableOverlappingCompaction: true,
17431746
EnableDelayedCompaction: opts.EnableDelayedCompaction,
1747+
EnableOverlappingCompaction: opts.EnableOverlappingCompaction,
17441748
}
17451749
}
17461750

tsdb/db.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ type Options struct {
187187
// The reason why this flag exists is because there are various users of the TSDB
188188
// that do not want vertical compaction happening on ingest time. Instead,
189189
// they'd rather keep overlapping blocks and let another component do the overlapping compaction later.
190-
// For Prometheus, this will always be true.
191190
EnableOverlappingCompaction bool
192191

193192
// EnableSharding enables query sharding support in TSDB.

0 commit comments

Comments
 (0)