Skip to content

Commit 380af11

Browse files
authored
Disable block deletion marks migration by default (#4597)
* Disable block deletion marks migration by default Flag is named `-compactor.block-deletion-marks-migration-enabled`. This feature was added in v1.7, so we expect most users to have upgraded by now. Signed-off-by: Bryan Boreham <[email protected]>
1 parent dd698bc commit 380af11

File tree

5 files changed

+4
-12
lines changed

5 files changed

+4
-12
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [ENHANCEMENT] Keep track of discarded samples due to relabel configuration in `cortex_discarded_samples_total`. #4503
66
* [CHANGE] Changed default for `-ingester.min-ready-duration` from 1 minute to 15 seconds. #4539
77
* [CHANGE] query-frontend: Do not print anything in the logs of `query-frontend` if a in-progress query has been canceled (context canceled). #4562
8+
* [CHANGE] Compactor block deletion mark migration, needed when upgrading from v1.7, is now disabled by default. #4597
89
* [ENHANCEMENT] Ruler: Add `-ruler.disable-rule-group-label` to disable the `rule_group` label on exported metrics. #4571
910
* [ENHANCEMENT] Query federation: improve performance in MergeQueryable by memoizing labels. #4502
1011
* [ENHANCEMENT] Added new ring related config `-ingester.readiness-check-ring-health` when enabled the readiness probe will succeed only after all instances are ACTIVE and healthy in the ring, this is enabled by default. #4539

docs/blocks-storage/compactor.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ compactor:
152152
# global location too. This option can (and should) be safely disabled as soon
153153
# as the compactor has successfully run at least once.
154154
# CLI flag: -compactor.block-deletion-marks-migration-enabled
155-
[block_deletion_marks_migration_enabled: <boolean> | default = true]
155+
[block_deletion_marks_migration_enabled: <boolean> | default = false]
156156

157157
# Comma separated list of tenants that can be compacted. If specified, only
158158
# these tenants will be compacted by compactor, otherwise all tenants can be

docs/blocks-storage/production-tips.md

-9
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,6 @@ The rule of thumb is that a production system shouldn't have the `file-max` ulim
8989

9090
The compactor generally needs a lot of disk space in order to download source blocks from the bucket and store the compacted block before uploading it to the storage. Please refer to [Compactor disk utilization](./compactor.md#compactor-disk-utilization) for more information about how to do capacity planning.
9191

92-
### Ensure deletion marks migration is disabled after first run
93-
94-
Cortex 1.7.0 introduced a change to store block deletion marks in a per-tenant global `markers/` location in the object store. If your Cortex cluster has been created with a Cortex version older than 1.7.0, the compactor needs to migrate deletion marks to the global location.
95-
96-
The migration is a one-time operation run at compactor startup. Running it at every compactor startup is a waste of resources and increases the compactor startup time so, once it successfully run once, you should disable it via `-compactor.block-deletion-marks-migration-enabled=false` (or its respective YAML config option).
97-
98-
You can see that the initial migration is done by looking for the following message in the compactor's logs:
99-
`msg="migrated block deletion marks to the global markers location"`.
100-
10192
## Caching
10293

10394
### Ensure memcached is properly scaled

docs/configuration/config-file-reference.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5296,7 +5296,7 @@ The `compactor_config` configures the compactor for the blocks storage.
52965296
# location too. This option can (and should) be safely disabled as soon as the
52975297
# compactor has successfully run at least once.
52985298
# CLI flag: -compactor.block-deletion-marks-migration-enabled
5299-
[block_deletion_marks_migration_enabled: <boolean> | default = true]
5299+
[block_deletion_marks_migration_enabled: <boolean> | default = false]
53005300
53015301
# Comma separated list of tenants that can be compacted. If specified, only
53025302
# these tenants will be compacted by compactor, otherwise all tenants can be

pkg/compactor/compactor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
147147
"If not 0, blocks will be marked for deletion and compactor component will permanently delete blocks marked for deletion from the bucket. "+
148148
"If 0, blocks will be deleted straight away. Note that deleting blocks immediately can cause query failures.")
149149
f.DurationVar(&cfg.TenantCleanupDelay, "compactor.tenant-cleanup-delay", 6*time.Hour, "For tenants marked for deletion, this is time between deleting of last block, and doing final cleanup (marker files, debug files) of the tenant.")
150-
f.BoolVar(&cfg.BlockDeletionMarksMigrationEnabled, "compactor.block-deletion-marks-migration-enabled", true, "When enabled, at compactor startup the bucket will be scanned and all found deletion marks inside the block location will be copied to the markers global location too. This option can (and should) be safely disabled as soon as the compactor has successfully run at least once.")
150+
f.BoolVar(&cfg.BlockDeletionMarksMigrationEnabled, "compactor.block-deletion-marks-migration-enabled", false, "When enabled, at compactor startup the bucket will be scanned and all found deletion marks inside the block location will be copied to the markers global location too. This option can (and should) be safely disabled as soon as the compactor has successfully run at least once.")
151151

152152
f.Var(&cfg.EnabledTenants, "compactor.enabled-tenants", "Comma separated list of tenants that can be compacted. If specified, only these tenants will be compacted by compactor, otherwise all tenants can be compacted. Subject to sharding.")
153153
f.Var(&cfg.DisabledTenants, "compactor.disabled-tenants", "Comma separated list of tenants that cannot be compacted by this compactor. If specified, and compactor would normally pick given tenant for compaction (via -compactor.enabled-tenants or sharding), it will be ignored instead.")

0 commit comments

Comments
 (0)