From 109432df4898ffe149261c2c6340d60745dcc4d3 Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Thu, 24 Aug 2023 20:34:57 +0200 Subject: [PATCH] Store: fix bufio pool handling Signed-off-by: Michael Hoffmann --- CHANGELOG.md | 1 + pkg/store/bucket.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b4ee32d8ec..cf15dbcabff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re ### Fixed - [#6650](https://github.com/thanos-io/thanos/pull/6650) Store: fix error handling in decodePostings +- [#6655](https://github.com/thanos-io/thanos/pull/6655) Store: fix bufio pool handling ### Added diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index 780a2013aa4..3db587f7425 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -2792,13 +2792,13 @@ func (r *bucketIndexReader) fetchPostings(ctx context.Context, keys []labels.Lab // We assume index does not have any ptrs that has 0 length. length := int64(part.End) - start - brdr := bufioReaderPool.Get().(*bufio.Reader) - defer bufioReaderPool.Put(brdr) - // Fetch from object storage concurrently and update stats and posting list. g.Go(func() error { begin := time.Now() + brdr := bufioReaderPool.Get().(*bufio.Reader) + defer bufioReaderPool.Put(brdr) + partReader, err := r.block.bkt.GetRange(ctx, r.block.indexFilename(), start, length) if err != nil { return errors.Wrap(err, "read postings range")