Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
* [BUGFIX] Querier: Fix panic due to request tracker truncating multi-byte UTF-8 character #7640
* [BUGFIX] Ingester: Fix panic (`HistogramProtoToHistogram called with a float histogram`) when ingesting a float native histogram with a zero count (e.g. a staleness marker or empty histogram). The decoder is now selected by histogram type via `IsFloatHistogram()` instead of by count value. #7645
* [BUGFIX] Querier: Fix parquet queryable fallback returning a nil error instead of the actual query error in `LabelValues` and `LabelNames`. #7638
* [BUGFIX] Store Gateway: Fix misleading "no index cache backend addresses" validation error being reported for chunks-cache, metadata-cache, and parquet caches when their memcached or redis backend is configured without addresses. The message is now the cache-type-agnostic "no cache backend addresses". #7675

## 1.21.0 2026-04-24

Expand Down
25 changes: 25 additions & 0 deletions pkg/storage/tsdb/caching_bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ func Test_BucketCacheBackendValidation(t *testing.T) {
},
expectedErr: errUnsupportedBucketCacheBackend,
},
"memcached backend without addresses": {
cfg: BucketCacheBackend{
Backend: CacheBackendMemcached,
},
expectedErr: errNoCacheAddresses,
},
"redis backend without addresses": {
cfg: BucketCacheBackend{
Backend: CacheBackendRedis,
},
expectedErr: errNoCacheAddresses,
},
"valid multi bucket cache type": {
cfg: BucketCacheBackend{
Backend: fmt.Sprintf("%s,%s,%s", CacheBackendInMemory, CacheBackendMemcached, CacheBackendRedis),
Expand Down Expand Up @@ -155,6 +167,19 @@ func Test_BucketCacheBackendValidation(t *testing.T) {
}
}

func Test_BucketCacheBackendValidation_MissingAddressesErrorIsGeneric(t *testing.T) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like Krunal said, I think. This is covered by the previous test. So you can remove it.

// A bucket cache (e.g. chunks-cache) is not an index cache, so the missing
// addresses error must not mention "index cache". See issue #6804.
for _, cfg := range []BucketCacheBackend{
{Backend: CacheBackendMemcached},
{Backend: CacheBackendRedis},
} {
err := cfg.Validate()
require.Error(t, err)
assert.Equal(t, "no cache backend addresses", err.Error())
}
}

func Test_BucketIndexCache(t *testing.T) {
const bucketIndexFile = "user1/bucket-index.json.gz"
const fileContent = "test-content"
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/tsdb/index_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var (

errUnsupportedIndexCacheBackend = errors.New("unsupported index cache backend")
errDuplicatedIndexCacheBackend = errors.New("duplicated index cache backend")
errNoIndexCacheAddresses = errors.New("no index cache backend addresses")
errNoCacheAddresses = errors.New("no cache backend addresses")
errInvalidMaxAsyncConcurrency = errors.New("invalid max_async_concurrency, must greater than 0")
errInvalidMaxAsyncBufferSize = errors.New("invalid max_async_buffer_size, must greater than 0")
errInvalidMaxBackfillItems = errors.New("invalid max_backfill_items, must greater than 0")
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/tsdb/index_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestIndexCacheConfig_Validate(t *testing.T) {
cfg: IndexCacheConfig{
Backend: "memcached",
},
expected: errNoIndexCacheAddresses,
expected: errNoCacheAddresses,
},
"one memcached address should pass": {
cfg: IndexCacheConfig{
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/tsdb/memcache_client_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (cfg *MemcachedClientConfig) GetAddresses() []string {
// Validate the config.
func (cfg *MemcachedClientConfig) Validate() error {
if len(cfg.GetAddresses()) == 0 {
return errNoIndexCacheAddresses
return errNoCacheAddresses
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/tsdb/redis_client_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (cfg *RedisClientConfig) RegisterFlagsWithPrefix(f *flag.FlagSet, prefix st
// Validate the config.
func (cfg *RedisClientConfig) Validate() error {
if cfg.Addresses == "" {
return errNoIndexCacheAddresses
return errNoCacheAddresses
}

if cfg.TLSEnabled {
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/tsdb/redis_client_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestRedisIndexCacheConfigValidate(t *testing.T) {
{
name: "empty address",
conf: &RedisClientConfig{},
err: errNoIndexCacheAddresses,
err: errNoCacheAddresses,
},
{
name: "provide TLS cert path but not key path",
Expand Down