Skip to content

Commit

Permalink
Merge pull request #257 from grafana/cleanup-blocks-storage
Browse files Browse the repository at this point in the history
Cleanup blocks storage config
  • Loading branch information
pracucci authored Feb 5, 2021
2 parents 5512bdd + 7ffa63b commit ea33cb1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* [CHANGE] Only single cluster and namespace can now be selected in "resources" dashboards. #251
* [CHANGE] Increased `CortexAllocatingTooMuchMemory` warning alert threshold from 50% to 65%. #256
* [CHANGE] Cleaned up blocks storage config. Moved CLI flags used only be the read path from `genericBlocksStorageConfig` to `queryBlocksStorageConfig`, and flags used only by the ingester from `genericBlocksStorageConfig` to `ingester_args`. #257
* [ENHANCEMENT] Added `unregister_ingesters_on_shutdown` config option to disable unregistering ingesters on shutdown (default is enabled). #213
* [ENHANCEMENT] Improved blocks storage observability: #237
- Cortex / Queries: added bucket index load operations and latency (available only when bucket index is enabled)
Expand Down
6 changes: 2 additions & 4 deletions cortex/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,10 @@

genericBlocksStorageConfig:: {
'store.engine': $._config.storage_engine, // May still be chunks
'blocks-storage.tsdb.dir': '/data/tsdb',
},
queryBlocksStorageConfig:: {
'blocks-storage.bucket-store.sync-dir': '/data/tsdb',
'blocks-storage.bucket-store.ignore-deletion-marks-delay': '1h',
'blocks-storage.tsdb.block-ranges-period': '2h',
'blocks-storage.tsdb.retention-period': '96h', // 4 days protection against blocks not being uploaded from ingesters.
'blocks-storage.tsdb.ship-interval': '1m',

'store-gateway.sharding-enabled': true,
'store-gateway.sharding-ring.store': 'consul',
Expand Down
10 changes: 8 additions & 2 deletions cortex/tsdb.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
'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,
querier_args+:: $._config.queryBlocksStorageConfig + $.blocks_metadata_caching_config + $.bucket_index_config,
ruler_args+:: $._config.queryBlocksStorageConfig + $.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 All @@ -87,6 +87,11 @@
ingester_deployment: {},

ingester_args+:: {
'blocks-storage.tsdb.dir': '/data/tsdb',
'blocks-storage.tsdb.block-ranges-period': '2h',
'blocks-storage.tsdb.retention-period': '96h', // 4 days protection against blocks not being uploaded from ingesters.
'blocks-storage.tsdb.ship-interval': '1m',

// Disable TSDB blocks transfer because of persistent volumes
'ingester.max-transfer-retries': 0,
'ingester.join-after': '0s',
Expand Down Expand Up @@ -196,6 +201,7 @@
$._config.grpcConfig +
$._config.storageConfig +
$._config.blocksStorageConfig +
$._config.queryBlocksStorageConfig +
{
target: 'store-gateway',
'limits.per-user-override-config': '/etc/cortex/overrides.yaml',
Expand Down

0 comments on commit ea33cb1

Please sign in to comment.