diff --git a/docs/blocks-storage/querier.md b/docs/blocks-storage/querier.md index ba6caa34e3..f0c5d89773 100644 --- a/docs/blocks-storage/querier.md +++ b/docs/blocks-storage/querier.md @@ -1020,7 +1020,8 @@ blocks_storage: [subrange_ttl: | default = 24h] metadata_cache: - # Backend for metadata cache, if not empty. Supported values: memcached. + # Backend for metadata cache, if not empty. Supported values: memcached, + # redis, and '' (disable). # CLI flag: -blocks-storage.bucket-store.metadata-cache.backend [backend: | default = ""] diff --git a/docs/blocks-storage/store-gateway.md b/docs/blocks-storage/store-gateway.md index 5279be4867..78a0e9674e 100644 --- a/docs/blocks-storage/store-gateway.md +++ b/docs/blocks-storage/store-gateway.md @@ -1135,7 +1135,8 @@ blocks_storage: [subrange_ttl: | default = 24h] metadata_cache: - # Backend for metadata cache, if not empty. Supported values: memcached. + # Backend for metadata cache, if not empty. Supported values: memcached, + # redis, and '' (disable). # CLI flag: -blocks-storage.bucket-store.metadata-cache.backend [backend: | default = ""] diff --git a/docs/configuration/config-file-reference.md b/docs/configuration/config-file-reference.md index ceda75705b..48329d1648 100644 --- a/docs/configuration/config-file-reference.md +++ b/docs/configuration/config-file-reference.md @@ -1568,7 +1568,8 @@ bucket_store: [subrange_ttl: | default = 24h] metadata_cache: - # Backend for metadata cache, if not empty. Supported values: memcached. + # Backend for metadata cache, if not empty. Supported values: memcached, + # redis, and '' (disable). # CLI flag: -blocks-storage.bucket-store.metadata-cache.backend [backend: | default = ""] diff --git a/pkg/storage/tsdb/caching_bucket.go b/pkg/storage/tsdb/caching_bucket.go index 4946e3f036..83a6700e1a 100644 --- a/pkg/storage/tsdb/caching_bucket.go +++ b/pkg/storage/tsdb/caching_bucket.go @@ -24,6 +24,8 @@ import ( ) var ( + supportedMetadataCacheBackends = []string{CacheBackendMemcached, CacheBackendRedis} + errUnsupportedChunkCacheBackend = errors.New("unsupported chunk cache backend") ) @@ -140,7 +142,7 @@ type MetadataCacheConfig struct { } func (cfg *MetadataCacheConfig) RegisterFlagsWithPrefix(f *flag.FlagSet, prefix string) { - f.StringVar(&cfg.Backend, prefix+"backend", "", fmt.Sprintf("Backend for metadata cache, if not empty. Supported values: %s.", CacheBackendMemcached)) + f.StringVar(&cfg.Backend, prefix+"backend", "", fmt.Sprintf("Backend for metadata cache, if not empty. Supported values: %s, and '' (disable).", strings.Join(supportedMetadataCacheBackends, ", "))) cfg.Memcached.RegisterFlagsWithPrefix(f, prefix+"memcached.") cfg.Redis.RegisterFlagsWithPrefix(f, prefix+"redis.")