Skip to content

Commit

Permalink
store: Record stats even on ExpandPostings error (thanos-io#6679)
Browse files Browse the repository at this point in the history
Signed-off-by: Saswata Mukherjee <[email protected]>
  • Loading branch information
saswatamcode committed Aug 31, 2023
1 parent 2bad830 commit 6520af2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6520af2

Please sign in to comment.