diff --git a/CHANGELOG.md b/CHANGELOG.md index 24f0d4be18..7568f27a8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,13 +18,28 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re ### Removed +## [v0.32.2](https://github.com/thanos-io/thanos/tree/release-0.32) - 31.08.2023 + +### Fixed + +- [#6675](https://github.com/thanos-io/thanos/pull/6675) Store: Fix race when iterating blocks +- [#6679](https://github.com/thanos-io/thanos/pull/6679) store: Record stats even on ExpandPostings error +- [#6681](https://github.com/thanos-io/thanos/pull/6681) Store: Fix forgotten field in store stats merge +- [#6684](https://github.com/thanos-io/thanos/pull/6684) Store: Fix postings reader short reads to address nil postings bug + +### Added + +### Changed + +### Removed + ## [v0.32.1](https://github.com/thanos-io/thanos/tree/release-0.32) - 28.08.2023 ### Fixed -- [#6650](https://github.com/thanos-io/thanos/pull/6650) Store: fix error handling in decodePostings -- [#6654](https://github.com/thanos-io/thanos/pull/6654) Store: fix ignored error in postings -- [#6655](https://github.com/thanos-io/thanos/pull/6655) Store: fix bufio pool handling +- [#6650](https://github.com/thanos-io/thanos/pull/6650) Store: Fix error handling in decodePostings +- [#6654](https://github.com/thanos-io/thanos/pull/6654) Store: Fix ignored error in postings +- [#6655](https://github.com/thanos-io/thanos/pull/6655) Store: Fix bufio pool handling - [#6669](https://github.com/thanos-io/thanos/pull/6669) Store: Fix mutable stringset memory usage ### Added diff --git a/VERSION b/VERSION index bd03320d42..1d6c0f6a07 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.32.1 \ No newline at end of file +0.32.2 \ No newline at end of file diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index 3db587f742..0d780fc2c7 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -1364,15 +1364,18 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, seriesSrv storepb.Store "block.resolution": blk.meta.Thanos.Downsample.Resolution, }) - if err := blockClient.ExpandPostings(sortedBlockMatchers, seriesLimiter); err != nil { - span.Finish() - return errors.Wrapf(err, "fetch series for block %s", blk.meta.ULID) - } onClose := func() { mtx.Lock() stats = blockClient.MergeStats(stats) mtx.Unlock() } + + if err := blockClient.ExpandPostings(sortedBlockMatchers, seriesLimiter); err != nil { + onClose() + span.Finish() + return errors.Wrapf(err, "fetch postings for block %s", blk.meta.ULID) + } + part := newLazyRespSet( srv.Context(), span, @@ -1693,6 +1696,9 @@ func (s *BucketStore) LabelNames(ctx context.Context, req *storepb.LabelNamesReq } func (s *BucketStore) UpdateLabelNames() { + s.mtx.RLock() + defer s.mtx.RUnlock() + newSet := stringset.New() for _, b := range s.blocks { labelNames, err := b.indexHeaderReader.LabelNames() @@ -2844,7 +2850,7 @@ func (r *bucketIndexReader) fetchPostings(ctx context.Context, keys []labels.Lab r.stats.PostingsFetchDurationSum += time.Since(begin) r.mtx.Unlock() - if rdr.Error() != nil { + if err := rdr.Error(); err != nil { return errors.Wrap(err, "reading postings") } return nil @@ -3522,6 +3528,7 @@ type queryStats struct { func (s queryStats) merge(o *queryStats) *queryStats { s.blocksQueried += o.blocksQueried + s.postingsToFetch += o.postingsToFetch s.postingsTouched += o.postingsTouched s.PostingsTouchedSizeSum += o.PostingsTouchedSizeSum s.postingsFetched += o.postingsFetched diff --git a/pkg/store/postings.go b/pkg/store/postings.go index 28fbf0cf01..e44dfbe66c 100644 --- a/pkg/store/postings.go +++ b/pkg/store/postings.go @@ -49,7 +49,7 @@ func newPostingsReaderBuilder(ctx context.Context, r *bufio.Reader, postings []p } func getInt32(r io.Reader, buf []byte) (uint32, error) { - read, err := r.Read(buf) + read, err := io.ReadFull(r, buf) if err != nil { return 0, errors.Wrap(err, "reading") }