Skip to content

Commit ebebef7

Browse files
authored
Modify default values for deletion delays. (#2414)
* Modify default values for deletion delays. Signed-off-by: Peter Štibraný <[email protected]> * Updated documentation Signed-off-by: Peter Štibraný <[email protected]> * Updated CHANGELOG.md with PR number. Signed-off-by: Peter Štibraný <[email protected]>
1 parent 74631c5 commit ebebef7

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* `cortex_querier_bucket_store_blocks_meta_sync_failures_total` > `cortex_querier_blocks_meta_sync_failures_total`
99
* `cortex_querier_bucket_store_blocks_meta_sync_duration_seconds` > `cortex_querier_blocks_meta_sync_duration_seconds`
1010
* `cortex_querier_bucket_store_blocks_meta_sync_consistency_delay_seconds` > `cortex_querier_blocks_meta_sync_consistency_delay_seconds`
11+
* [CHANGE] Experimental TSDB: Modified default values for `compactor.deletion-delay` option from 48h to 12h and `-experimental.tsdb.bucket-store.ignore-deletion-marks-delay` from 24h to 6h. #2414
1112
* [ENHANCEMENT] Experimental TSDB: sample ingestion errors are now reported via existing `cortex_discarded_samples_total` metric. #2370
1213
* [ENHANCEMENT] Failures on samples at distributors and ingesters return the first validation error as opposed to the last. #2383
1314
* [ENHANCEMENT] Experimental TSDB: Added `cortex_querier_blocks_meta_synced`, which reflects current state of synced blocks over all tenants. #2392

docs/configuration/config-file-reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,10 +2441,10 @@ bucket_store:
24412441
# while fetching blocks. The idea of ignore-deletion-marks-delay is to ignore
24422442
# blocks that are marked for deletion with some delay. This ensures store can
24432443
# still serve blocks that are meant to be deleted but do not have a
2444-
# replacement yet.Default is 24h, half of the default value for
2444+
# replacement yet.Default is 6h, half of the default value for
24452445
# -compactor.deletion-delay.
24462446
# CLI flag: -experimental.tsdb.bucket-store.ignore-deletion-marks-delay
2447-
[ignore_deletion_mark_delay: <duration> | default = 24h0m0s]
2447+
[ignore_deletion_mark_delay: <duration> | default = 6h0m0s]
24482448
24492449
# How frequently does Cortex try to compact TSDB head. Block is only created if
24502450
# data covers smallest block range. Must be greater than 0 and max 5 minutes.
@@ -2571,7 +2571,7 @@ The `compactor_config` configures the compactor for the experimental blocks stor
25712571
# failures, if store gateway still has the block loaded, or compactor is
25722572
# ignoring the deletion because it's compacting the block at the same time.
25732573
# CLI flag: -compactor.deletion-delay
2574-
[deletion_delay: <duration> | default = 48h0m0s]
2574+
[deletion_delay: <duration> | default = 12h0m0s]
25752575
25762576
# Shard tenants across multiple compactor instances. Sharding is required if you
25772577
# run multiple compactor instances, in order to coordinate compactions and avoid

docs/operations/blocks-storage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,10 @@ tsdb:
265265
# while fetching blocks. The idea of ignore-deletion-marks-delay is to
266266
# ignore blocks that are marked for deletion with some delay. This ensures
267267
# store can still serve blocks that are meant to be deleted but do not have
268-
# a replacement yet.Default is 24h, half of the default value for
268+
# a replacement yet.Default is 6h, half of the default value for
269269
# -compactor.deletion-delay.
270270
# CLI flag: -experimental.tsdb.bucket-store.ignore-deletion-marks-delay
271-
[ignore_deletion_mark_delay: <duration> | default = 24h0m0s]
271+
[ignore_deletion_mark_delay: <duration> | default = 6h0m0s]
272272
273273
# How frequently does Cortex try to compact TSDB head. Block is only created
274274
# if data covers smallest block range. Must be greater than 0 and max 5
@@ -398,7 +398,7 @@ compactor:
398398
# compactor is ignoring the deletion because it's compacting the block at the
399399
# same time.
400400
# CLI flag: -compactor.deletion-delay
401-
[deletion_delay: <duration> | default = 48h0m0s]
401+
[deletion_delay: <duration> | default = 12h0m0s]
402402
403403
# Shard tenants across multiple compactor instances. Sharding is required if
404404
# you run multiple compactor instances, in order to coordinate compactions and

pkg/compactor/compactor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
6464
f.DurationVar(&cfg.CompactionInterval, "compactor.compaction-interval", time.Hour, "The frequency at which the compaction runs")
6565
f.IntVar(&cfg.CompactionRetries, "compactor.compaction-retries", 3, "How many times to retry a failed compaction during a single compaction interval")
6666
f.BoolVar(&cfg.ShardingEnabled, "compactor.sharding-enabled", false, "Shard tenants across multiple compactor instances. Sharding is required if you run multiple compactor instances, in order to coordinate compactions and avoid race conditions leading to the same tenant blocks simultaneously compacted by different instances.")
67-
f.DurationVar(&cfg.DeletionDelay, "compactor.deletion-delay", 48*time.Hour, "Time before a block marked for deletion is deleted from bucket. "+
67+
f.DurationVar(&cfg.DeletionDelay, "compactor.deletion-delay", 12*time.Hour, "Time before a block marked for deletion is deleted from bucket. "+
6868
"If not 0, blocks will be marked for deletion and compactor component will delete blocks marked for deletion from the bucket. "+
6969
"If delete-delay is 0, blocks will be deleted straight away. Note that deleting blocks immediately can cause query failures, "+
7070
"if store gateway still has the block loaded, or compactor is ignoring the deletion because it's compacting the block at the same time.")

pkg/storage/tsdb/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ func (cfg *BucketStoreConfig) RegisterFlags(f *flag.FlagSet) {
184184
f.IntVar(&cfg.MetaSyncConcurrency, "experimental.tsdb.bucket-store.meta-sync-concurrency", 20, "Number of Go routines to use when syncing block meta files from object storage per tenant.")
185185
f.BoolVar(&cfg.BinaryIndexHeader, "experimental.tsdb.bucket-store.binary-index-header-enabled", true, "Whether the bucket store should use the binary index header. If false, it uses the JSON index header.")
186186
f.DurationVar(&cfg.ConsistencyDelay, "experimental.tsdb.bucket-store.consistency-delay", 0, "Minimum age of a block before it's being read. Set it to safe value (e.g 30m) if your object storage is eventually consistent. GCS and S3 are (roughly) strongly consistent.")
187-
f.DurationVar(&cfg.IgnoreDeletionMarksDelay, "experimental.tsdb.bucket-store.ignore-deletion-marks-delay", time.Hour*24, "Duration after which the blocks marked for deletion will be filtered out while fetching blocks. "+
187+
f.DurationVar(&cfg.IgnoreDeletionMarksDelay, "experimental.tsdb.bucket-store.ignore-deletion-marks-delay", time.Hour*6, "Duration after which the blocks marked for deletion will be filtered out while fetching blocks. "+
188188
"The idea of ignore-deletion-marks-delay is to ignore blocks that are marked for deletion with some delay. This ensures store can still serve blocks that are meant to be deleted but do not have a replacement yet."+
189-
"Default is 24h, half of the default value for -compactor.deletion-delay.")
189+
"Default is 6h, half of the default value for -compactor.deletion-delay.")
190190
}
191191

192192
// Validate the config.

0 commit comments

Comments
 (0)