Skip to content

Commit 031b51c

Browse files
Julien Pivottopracucci
andauthored
Error if the store gateway is run on an invalid engine (#3287)
This pull request returns an explicit error if the user asks to start the store gateway but omits to set the storage type to `blocks`. The previous behaviour was to silently ignore the -target=store-gateway argument. Note that this does not apply when target is `all`. Signed-off-by: Julien Pivotto <[email protected]> Co-authored-by: Marco Pracucci <[email protected]>
1 parent 4b685e5 commit 031b51c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
* [ENHANCEMENT] Experimental Ruler API: Fetch rule groups from object storage in parallel. #3218
6666
* [ENHANCEMENT] Chunks GCS object storage client uses the `fields` selector to limit the payload size when listing objects in the bucket. #3218 #3292
6767
* [ENHANCEMENT] Added shuffle sharding support to ruler. Added new metric `cortex_ruler_sync_rules_total`. #3235
68+
* [ENHANCEMENT] Return an explicit error when the store-gateway is explicitly requested without a blocks storage engine. #3287
6869
* [ENHANCEMENT] Ruler: only load rules that belong to the ruler. Improves rules synching performances when ruler sharding is enabled. #3269
6970
* [BUGFIX] No-longer-needed ingester operations for queries triggered by queriers and rulers are now canceled. #3178
7071
* [BUGFIX] Ruler: directories in the configured `rules-path` will be removed on startup and shutdown in order to ensure they don't persist between runs. #3195

pkg/cortex/modules.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,9 @@ func (t *Cortex) initCompactor() (serv services.Service, err error) {
593593

594594
func (t *Cortex) initStoreGateway() (serv services.Service, err error) {
595595
if t.Cfg.Storage.Engine != storage.StorageEngineBlocks {
596+
if t.Cfg.Target != All {
597+
return nil, fmt.Errorf("storage engine must be set to blocks to enable the store-gateway")
598+
}
596599
return nil, nil
597600
}
598601

0 commit comments

Comments
 (0)