Skip to content

Commit

Permalink
store: Record stats even on ExpandPostings error (#6679)
Browse files Browse the repository at this point in the history
  • Loading branch information
saswatamcode authored Aug 30, 2023
1 parent ea67282 commit fac3193
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 fac3193

Please sign in to comment.