Skip to content

Commit

Permalink
Added bucket index flag, and enable bucket index by default. (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
pstibrany authored Jan 20, 2021
1 parent b9814fe commit a96768d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Cortex / Queries: added bucket index load operations and latency (available only when bucket index is enabled)
- Alerts: added "CortexBucketIndexNotUpdated" (bucket index only) and "CortexTenantHasPartialBlocks"
* [ENHANCEMENT] The name of the overrides configmap is now customisable via `$._config.overrides_configmap`. #244
* [ENHANCEMENT] Added flag to control usage of bucket-index, and enable it by default when using blocks. #254
* [BUGFIX] Honor configured `per_instance_label` in all panels. #239
* [BUGFIX] `CortexRequestLatency` alert now ignores long-running requests on query-scheduler. #242
* [BUGFIX] Honor configured `job_names` in the "Memory (go heap inuse)" panel. #247
Expand Down
23 changes: 20 additions & 3 deletions cortex/tsdb.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@

// Allow to fine tune compactor.
cortex_compactor_max_concurrency: 1,
// While this is the default value, we want to pass the same to the -blocks-storage.bucket-store.sync-interval
cortex_compactor_cleanup_interval: '15m',

// Enable use of bucket index by querier, ruler and store-gateway.
// Bucket index is generated by compactor from Cortex 1.7, there is no flag required to enable this on compactor.
cortex_bucket_index_enabled: false,
},

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

querier_args+:: $.blocks_metadata_caching_config,
ruler_args+:: $.blocks_metadata_caching_config,
bucket_index_config:: if $._config.cortex_bucket_index_enabled then {
'blocks-storage.bucket-store.bucket-index.enabled': true,

// Bucket index is updated by compactor on each cleanup cycle.
'blocks-storage.bucket-store.sync-interval': $._config.cortex_compactor_cleanup_interval,
} else {},

querier_args+:: $.blocks_metadata_caching_config + $.bucket_index_config,
ruler_args+:: $.blocks_metadata_caching_config + $.bucket_index_config,

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

// Enable sharding.
'compactor.sharding-enabled': true,
Expand Down Expand Up @@ -189,7 +203,10 @@
// Persist ring tokens so that when the store-gateway will be restarted
// it will pick the same tokens
'store-gateway.sharding-ring.tokens-file-path': '/data/tokens',
} + $.blocks_chunks_caching_config + $.blocks_metadata_caching_config,
} +
$.blocks_chunks_caching_config +
$.blocks_metadata_caching_config +
$.bucket_index_config,

store_gateway_ports:: $.util.defaultPorts,

Expand Down

0 comments on commit a96768d

Please sign in to comment.