From 9c24e8ecc6701f44bb99e483baaed271e308a458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= Date: Wed, 4 Jan 2023 19:58:13 +0200 Subject: [PATCH] *: cut 0.30.1 (#6017) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix duplicate metrics registration in redis client (#6009) * fix duplicate metrics registration in redis client Signed-off-by: Kama Huang * fixed test Signed-off-by: Kama Huang Signed-off-by: Kama Huang * *: cut 0.30.1 Add CHANGELOG entry. Signed-off-by: Giedrius Statkevičius Signed-off-by: Kama Huang Signed-off-by: Giedrius Statkevičius Co-authored-by: Kama Huang <121007071+kama910@users.noreply.github.com> --- CHANGELOG.md | 24 ++++++++++++++++++++++++ VERSION | 2 +- pkg/cacheutil/cacheutil_test.go | 6 +++++- pkg/cacheutil/redis_client.go | 17 ++++++----------- pkg/cacheutil/redis_client_test.go | 16 ++++++++++++++++ 5 files changed, 52 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ed9cce32a..aeca5d1d5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,30 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#5759](https://github.com/thanos-io/thanos/pull/5759) Compact: Fix missing duration log key. - [#5799](https://github.com/thanos-io/thanos/pull/5799) Query Frontend: Fixed sharding behaviour for vector matches. Now queries with sharding should work properly where the query looks like: `foo and without (lbl) bar`. +## [v0.30.1](https://github.com/thanos-io/thanos/tree/release-0.30) - 4.01.2023 + +### Fixed + +- [#6009](https://github.com/thanos-io/thanos/pull/6009) Query Frontend/Store: fix duplicate metrics registration in Redis client + +## [v0.30.0](https://github.com/thanos-io/thanos/tree/release-0.30) - 2.01.2023 + +NOTE: Querier's `query.promql-engine` flag enabling new PromQL engine is now unhidden. We encourage users to use new experimental PromQL engine for efficiency reasons. + +### Fixed + +- [#5716](https://github.com/thanos-io/thanos/pull/5716) DNS: Fix miekgdns resolver LookupSRV to work with CNAME records. +- [#5844](https://github.com/thanos-io/thanos/pull/5844) Query Frontend: Fixes @ modifier time range when splitting queries by interval. +- [#5854](https://github.com/thanos-io/thanos/pull/5854) Query Frontend: `lookback_delta` param is now handled in query frontend. +- [#5860](https://github.com/thanos-io/thanos/pull/5860) Query: Fixed bug of not showing query warnings in Thanos UI. +- [#5856](https://github.com/thanos-io/thanos/pull/5856) Store: Fixed handling of debug logging flag. +- [#5230](https://github.com/thanos-io/thanos/pull/5230) Rule: Stateless ruler support restoring `for` state from query API servers. The query API servers should be able to access the remote write storage. +- [#5880](https://github.com/thanos-io/thanos/pull/5880) Query Frontend: Fixes some edge cases of query sharding analysis. +- [#5893](https://github.com/thanos-io/thanos/pull/5893) Cache: Fixed redis client not respecting `SetMultiBatchSize` config value. +- [#5966](https://github.com/thanos-io/thanos/pull/5966) Query: Stop relying on non-existent hints for mint and maxt when selecting series for the `api/v1/series` HTTP endpoint. +- [#5948](https://github.com/thanos-io/thanos/pull/5948) Store: `chunks_fetched_duration` wrong calculation. +- [#5910](https://github.com/thanos-io/thanos/pull/5910): Receive: Fixed ketama quorum bug that was could cause success response for failed replication. This also optimize heavily receiver CPU use. + ### Added - [#5565](https://github.com/thanos-io/thanos/pull/5565) Receive: Allow remote write request limits to be defined per file and tenant (experimental). * [#5654](https://github.com/thanos-io/thanos/pull/5654) Query: add `--grpc-compression` flag that controls the compression used in gRPC client. With the flag it is now possible to compress the traffic between Query and StoreAPI nodes - you get lower network usage in exchange for a bit higher CPU/RAM usage. diff --git a/VERSION b/VERSION index ae6dd4e203..1a44cad74d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.29.0 +0.30.1 diff --git a/pkg/cacheutil/cacheutil_test.go b/pkg/cacheutil/cacheutil_test.go index 631903b55f..083e2a389f 100644 --- a/pkg/cacheutil/cacheutil_test.go +++ b/pkg/cacheutil/cacheutil_test.go @@ -16,7 +16,11 @@ import ( ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain( + m, + // https://github.com/rueian/rueidis/blob/v0.0.90/pipe.go#L204. + goleak.IgnoreTopFunction("github.com/rueian/rueidis.(*pipe).backgroundPing"), + ) } func TestDoWithBatch(t *testing.T) { diff --git a/pkg/cacheutil/redis_client.go b/pkg/cacheutil/redis_client.go index a12c8d5e83..fe688df025 100644 --- a/pkg/cacheutil/redis_client.go +++ b/pkg/cacheutil/redis_client.go @@ -161,19 +161,14 @@ func NewRedisClientWithConfig(logger log.Logger, name string, config RedisClient return nil, err } - opts := &redis.Options{ - Addr: config.Addr, - Username: config.Username, - Password: config.Password, - DB: config.DB, - DialTimeout: config.DialTimeout, - ReadTimeout: config.ReadTimeout, - WriteTimeout: config.WriteTimeout, - MinIdleConns: config.MinIdleConns, - MaxConnAge: config.MaxConnAge, - IdleTimeout: config.IdleTimeout, + if reg != nil { + reg = prometheus.WrapRegistererWith(prometheus.Labels{"name": name}, reg) } + var tlsConfig *tls.Config + if config.TLSEnabled { + userTLSConfig := config.TLSConfig + if config.TLSEnabled { tlsConfig := config.TLSConfig diff --git a/pkg/cacheutil/redis_client_test.go b/pkg/cacheutil/redis_client_test.go index 8dfc1cafdc..5d3ec27c5d 100644 --- a/pkg/cacheutil/redis_client_test.go +++ b/pkg/cacheutil/redis_client_test.go @@ -219,3 +219,19 @@ func TestValidateRedisConfig(t *testing.T) { } } + +func TestMultipleRedisClient(t *testing.T) { + s, err := miniredis.Run() + if err != nil { + testutil.Ok(t, err) + } + defer s.Close() + cfg := DefaultRedisClientConfig + cfg.Addr = s.Addr() + logger := log.NewLogfmtLogger(os.Stderr) + reg := prometheus.NewRegistry() + _, err = NewRedisClientWithConfig(logger, "test1", cfg, reg) + testutil.Ok(t, err) + _, err = NewRedisClientWithConfig(logger, "test2", cfg, reg) + testutil.Ok(t, err) +}