From 034d62fe3c2374887a4c331ccf299096b8f805f5 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 --- pkg/store/bucket.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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")