Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit a96768d

Browse files
authored
Added bucket index flag, and enable bucket index by default. (#254)
1 parent b9814fe commit a96768d

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Cortex / Queries: added bucket index load operations and latency (available only when bucket index is enabled)
99
- Alerts: added "CortexBucketIndexNotUpdated" (bucket index only) and "CortexTenantHasPartialBlocks"
1010
* [ENHANCEMENT] The name of the overrides configmap is now customisable via `$._config.overrides_configmap`. #244
11+
* [ENHANCEMENT] Added flag to control usage of bucket-index, and enable it by default when using blocks. #254
1112
* [BUGFIX] Honor configured `per_instance_label` in all panels. #239
1213
* [BUGFIX] `CortexRequestLatency` alert now ignores long-running requests on query-scheduler. #242
1314
* [BUGFIX] Honor configured `job_names` in the "Memory (go heap inuse)" panel. #247

cortex/tsdb.libsonnet

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424

2525
// Allow to fine tune compactor.
2626
cortex_compactor_max_concurrency: 1,
27+
// While this is the default value, we want to pass the same to the -blocks-storage.bucket-store.sync-interval
28+
cortex_compactor_cleanup_interval: '15m',
29+
30+
// Enable use of bucket index by querier, ruler and store-gateway.
31+
// Bucket index is generated by compactor from Cortex 1.7, there is no flag required to enable this on compactor.
32+
cortex_bucket_index_enabled: false,
2733
},
2834

2935
blocks_chunks_caching_config::
@@ -59,8 +65,15 @@
5965
'blocks-storage.bucket-store.metadata-cache.memcached.max-get-multi-batch-size': '100',
6066
} else {},
6167

62-
querier_args+:: $.blocks_metadata_caching_config,
63-
ruler_args+:: $.blocks_metadata_caching_config,
68+
bucket_index_config:: if $._config.cortex_bucket_index_enabled then {
69+
'blocks-storage.bucket-store.bucket-index.enabled': true,
70+
71+
// Bucket index is updated by compactor on each cleanup cycle.
72+
'blocks-storage.bucket-store.sync-interval': $._config.cortex_compactor_cleanup_interval,
73+
} else {},
74+
75+
querier_args+:: $.blocks_metadata_caching_config + $.bucket_index_config,
76+
ruler_args+:: $.blocks_metadata_caching_config + $.bucket_index_config,
6477

6578
// The ingesters should persist TSDB blocks and WAL on a persistent
6679
// volume in order to be crash resilient.
@@ -134,6 +147,7 @@
134147
'compactor.data-dir': '/data',
135148
'compactor.compaction-interval': '30m',
136149
'compactor.compaction-concurrency': $._config.cortex_compactor_max_concurrency,
150+
'compactor.cleanup-interval': $._config.cortex_compactor_cleanup_interval,
137151

138152
// Enable sharding.
139153
'compactor.sharding-enabled': true,
@@ -189,7 +203,10 @@
189203
// Persist ring tokens so that when the store-gateway will be restarted
190204
// it will pick the same tokens
191205
'store-gateway.sharding-ring.tokens-file-path': '/data/tokens',
192-
} + $.blocks_chunks_caching_config + $.blocks_metadata_caching_config,
206+
} +
207+
$.blocks_chunks_caching_config +
208+
$.blocks_metadata_caching_config +
209+
$.bucket_index_config,
193210

194211
store_gateway_ports:: $.util.defaultPorts,
195212

0 commit comments

Comments
 (0)