From bb9c3ca7fa348629481320de70b19ca425f2cb52 Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Thu, 18 Jan 2024 20:18:35 -0800 Subject: [PATCH 1/2] fix passing of redis client cache size Signed-off-by: Ben Ye --- pkg/storage/tsdb/redis_client_config.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/storage/tsdb/redis_client_config.go b/pkg/storage/tsdb/redis_client_config.go index 1331080430..f7acbb5e79 100644 --- a/pkg/storage/tsdb/redis_client_config.go +++ b/pkg/storage/tsdb/redis_client_config.go @@ -2,6 +2,7 @@ package tsdb import ( "flag" + "github.com/thanos-io/thanos/pkg/model" "time" "github.com/pkg/errors" @@ -97,5 +98,6 @@ func (cfg *RedisClientConfig) ToRedisClientConfig() cacheutil.RedisClientConfig ServerName: cfg.TLS.ServerName, InsecureSkipVerify: cfg.TLS.InsecureSkipVerify, }, + CacheSize: model.Bytes(cfg.CacheSize), } } From 98f96fe2a698b9be1bf410f6779d5a213dde7660 Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Thu, 18 Jan 2024 20:21:12 -0800 Subject: [PATCH 2/2] changelog Signed-off-by: Ben Ye --- CHANGELOG.md | 1 + pkg/storage/tsdb/redis_client_config.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2717ca2e1..b4b1fe9ee5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * [ENHANCEMENT] Query Frontend: Log number of split queries in `query stats` log. #5703 * [BUGFIX] Distributor: Do not use label with empty values for sharding #5717 * [BUGFIX] Query Frontend: queries with negative offset should check whether it is cacheable or not. #5719 +* [BUGFIX] Redis Cache: pass `cache_size` config correctly. #5734 ## 1.16.0 2023-11-20 diff --git a/pkg/storage/tsdb/redis_client_config.go b/pkg/storage/tsdb/redis_client_config.go index f7acbb5e79..4d38221bd7 100644 --- a/pkg/storage/tsdb/redis_client_config.go +++ b/pkg/storage/tsdb/redis_client_config.go @@ -2,11 +2,12 @@ package tsdb import ( "flag" - "github.com/thanos-io/thanos/pkg/model" + "time" "github.com/pkg/errors" "github.com/thanos-io/thanos/pkg/cacheutil" + "github.com/thanos-io/thanos/pkg/model" "github.com/cortexproject/cortex/pkg/util/tls" )