From 77bd9c0cbb96c435ec98f9221fd898835f3050a6 Mon Sep 17 00:00:00 2001 From: Filip Petkovski Date: Tue, 5 Nov 2024 13:36:40 +0100 Subject: [PATCH 1/3] Fix bug in Bucket Series Applies the fix described in https://github.com/thanos-io/thanos/issues/7883. Signed-off-by: Filip Petkovski --- pkg/store/bucket.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index 7ab47f4cbe..744823c9fe 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -1691,7 +1691,9 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, seriesSrv storepb.Store // Merge the sub-results from each selected block. tracing.DoInSpan(ctx, "bucket_store_merge_all", func(ctx context.Context) { begin := time.Now() - set := NewResponseDeduplicator(NewProxyResponseLoserTree(respSets...)) + lt := NewProxyResponseLoserTree(respSets...) + defer lt.Close() + set := NewResponseDeduplicator(lt) i := 0 for set.Next() { i++ From 62eb843f940dc005d9bfd360169e3b8c570fd812 Mon Sep 17 00:00:00 2001 From: Filip Petkovski Date: Tue, 5 Nov 2024 13:38:02 +0100 Subject: [PATCH 2/3] Add CHANGELOG entry Signed-off-by: Filip Petkovski --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index afd59dc440..9cb87493c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#7821](https://github.com/thanos-io/thanos/pull/7679) Query/Receive: Fix coroutine leak introduced in https://github.com/thanos-io/thanos/pull/7796. - [#7843](https://github.com/thanos-io/thanos/pull/7843) Query Frontend: fix slow query logging for non-query endpoints. - [#7852](https://github.com/thanos-io/thanos/pull/7852) Query Frontend: pass "stats" parameter forward to queriers and fix Prometheus stats merging. +- [#7885](https://github.com/thanos-io/thanos/pull/7885) Store: Return chunks to the pool after completing a Series call. ### Added - [#7763](https://github.com/thanos-io/thanos/pull/7763) Ruler: use native histograms for client latency metrics. From 4550964eb5b9a7f4a4943fe856a347bcf65c99b7 Mon Sep 17 00:00:00 2001 From: Filip Petkovski Date: Tue, 5 Nov 2024 19:56:44 +0100 Subject: [PATCH 3/3] Close loser tree outside of span Signed-off-by: Filip Petkovski --- pkg/store/bucket.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index 744823c9fe..eec1de1005 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -1688,11 +1688,11 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, seriesSrv storepb.Store s.metrics.seriesBlocksQueried.WithLabelValues(tenant).Observe(float64(stats.blocksQueried)) } + lt := NewProxyResponseLoserTree(respSets...) + defer lt.Close() // Merge the sub-results from each selected block. tracing.DoInSpan(ctx, "bucket_store_merge_all", func(ctx context.Context) { begin := time.Now() - lt := NewProxyResponseLoserTree(respSets...) - defer lt.Close() set := NewResponseDeduplicator(lt) i := 0 for set.Next() {