Skip to content

Commit 2251e9a

Browse files
compactor, store-gateway: always upload sparse headers (#13089)
<!-- Thanks for sending a pull request! Before submitting: 1. Read our CONTRIBUTING.md guide 2. Rebase your PR if it gets out of sync with main --> #### What this PR does follow-up of #10684. We've been running this at GL for some time without problems. This is the next step towards removing the flag. #### Which issue(s) this PR fixes or relates to Fixes #<issue number> #### Checklist - [ ] Tests updated. - [ ] Documentation added. - [x] `CHANGELOG.md` updated - the order of entries should be `[CHANGE]`, `[FEATURE]`, `[ENHANCEMENT]`, `[BUGFIX]`. If changelog entry is not needed, please add the `changelog-not-needed` label to the PR. - [ ] [`about-versioning.md`](https://github.com/grafana/mimir/blob/main/docs/sources/mimir/configure/about-versioning.md) updated with experimental features. --------- Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
1 parent 883442f commit 2251e9a

File tree

7 files changed

+8
-4
lines changed

7 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Grafana Mimir
66

77
* [BUGFIX] Compactor: Fix potential concurrent map writes. #13053
8+
* [ENHANCEMENT] Compactor, Store-gateway: Change default value of `-compactor.upload-sparse-index-headers` to `true`. This improves lazy loading performance in the store-gateway. #13089
89

910
### Mixin
1011

cmd/mimir/config-descriptor.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11630,7 +11630,7 @@
1163011630
"required": false,
1163111631
"desc": "If enabled, the compactor constructs and uploads sparse index headers to object storage during each compaction cycle. This allows store-gateway instances to use the sparse headers from object storage instead of recreating them locally.",
1163211632
"fieldValue": null,
11633-
"fieldDefaultValue": false,
11633+
"fieldDefaultValue": true,
1163411634
"fieldFlag": "compactor.upload-sparse-index-headers",
1163511635
"fieldType": "boolean",
1163611636
"fieldCategory": "experimental"

cmd/mimir/help-all.txt.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ Usage of ./cmd/mimir/mimir:
11661166
-compactor.update-blocks-concurrency int
11671167
Number of goroutines to use when updating blocks metadata during bucket index updates. (default 1)
11681168
-compactor.upload-sparse-index-headers
1169-
[experimental] If enabled, the compactor constructs and uploads sparse index headers to object storage during each compaction cycle. This allows store-gateway instances to use the sparse headers from object storage instead of recreating them locally.
1169+
[experimental] If enabled, the compactor constructs and uploads sparse index headers to object storage during each compaction cycle. This allows store-gateway instances to use the sparse headers from object storage instead of recreating them locally. (default true)
11701170
-config.expand-env
11711171
Expands ${var} or $var in config according to the values of the environment variables.
11721172
-config.file value

docs/sources/mimir/configure/configuration-parameters/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5379,7 +5379,7 @@ sharding_ring:
53795379
# store-gateway instances to use the sparse headers from object storage instead
53805380
# of recreating them locally.
53815381
# CLI flag: -compactor.upload-sparse-index-headers
5382-
[upload_sparse_index_headers: <boolean> | default = false]
5382+
[upload_sparse_index_headers: <boolean> | default = true]
53835383
```
53845384

53855385
### store_gateway

operations/mimir/mimir-flags-defaults.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,7 @@
821821
"compactor.ring.wait-active-instance-timeout": 600000000000,
822822
"compactor.ring.auto-forget-unhealthy-periods": 10,
823823
"compactor.compaction-jobs-order": "smallest-range-oldest-blocks-first",
824+
"compactor.upload-sparse-index-headers": true,
824825
"store-gateway.sharding-ring.store": "memberlist",
825826
"store-gateway.sharding-ring.prefix": "collectors/",
826827
"store-gateway.sharding-ring.consul.hostname": "localhost:8500",

pkg/compactor/compactor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet, logger log.Logger) {
161161
"If 0, blocks will be deleted straight away. Note that deleting blocks immediately can cause query failures.")
162162
f.DurationVar(&cfg.TenantCleanupDelay, "compactor.tenant-cleanup-delay", 6*time.Hour, "For tenants marked for deletion, this is the time between deletion of the last block, and doing final cleanup (marker files, debug files) of the tenant.")
163163
f.BoolVar(&cfg.NoBlocksFileCleanupEnabled, "compactor.no-blocks-file-cleanup-enabled", false, "If enabled, will delete the bucket-index, markers and debug files in the tenant bucket when there are no blocks left in the index.")
164-
f.BoolVar(&cfg.UploadSparseIndexHeaders, "compactor.upload-sparse-index-headers", false, "If enabled, the compactor constructs and uploads sparse index headers to object storage during each compaction cycle. This allows store-gateway instances to use the sparse headers from object storage instead of recreating them locally.")
164+
f.BoolVar(&cfg.UploadSparseIndexHeaders, "compactor.upload-sparse-index-headers", true, "If enabled, the compactor constructs and uploads sparse index headers to object storage during each compaction cycle. This allows store-gateway instances to use the sparse headers from object storage instead of recreating them locally.")
165165

166166
// compactor concurrency options
167167
f.IntVar(&cfg.MaxOpeningBlocksConcurrency, "compactor.max-opening-blocks-concurrency", 1, "Number of goroutines opening blocks before compaction.")

pkg/compactor/compactor_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,6 +1769,8 @@ func prepareConfig(t *testing.T) Config {
17691769
// The new default is 25m, but tests rely on the previous value of 0s
17701770
compactorCfg.CompactionWaitPeriod = 0
17711771

1772+
compactorCfg.SparseIndexHeadersSamplingRate = 32
1773+
17721774
return compactorCfg
17731775
}
17741776

0 commit comments

Comments
 (0)