Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
  • Loading branch information
fpetkovski committed Oct 31, 2022
1 parent 1e21e4d commit 9f4f13a
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storepb.Store_Serie
bytesLimiter = s.bytesLimiterFactory(s.metrics.queriesDropped.WithLabelValues("bytes"))
ctx = srv.Context()
stats = &queryStats{}
res []respSet
respSets []respSet
mtx sync.Mutex
g, gctx = errgroup.WithContext(ctx)
resHints = &hintspb.SeriesResponseHints{}
Expand Down Expand Up @@ -1245,7 +1245,7 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storepb.Store_Serie
)

mtx.Lock()
res = append(res, part)
respSets = append(respSets, part)
mtx.Unlock()

return nil
Expand Down Expand Up @@ -1297,23 +1297,28 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storepb.Store_Serie
}
return status.Error(code, err.Error())
}
stats.blocksQueried = len(res)
stats.blocksQueried = len(respSets)
stats.GetAllDuration = time.Since(begin)
s.metrics.seriesGetAllDuration.Observe(stats.GetAllDuration.Seconds())
s.metrics.seriesBlocksQueried.Observe(float64(stats.blocksQueried))
}

// Merge the sub-results from each selected block.
tracing.DoInSpan(ctx, "bucket_store_merge_all", func(ctx context.Context) {
defer func() {
for _, resp := range respSets {
resp.Close()
}
}()
begin := time.Now()
set := NewDedupResponseHeap(NewProxyResponseHeap(res...))
set := NewDedupResponseHeap(NewProxyResponseHeap(respSets...))
for set.Next() {
at := set.At()
warn := at.GetWarning()
if warn != "" {
// TODO(fpetkovski): Consider deprecating string based warnings
// TODO(fpetkovski): in favor of a separate protobuf message containing
// TODO(fpetkovski): the grpc code and a human readable error message.
// TODO(fpetkovski): Consider deprecating string based warnings in favor of a
// separate protobuf message containing the grpc code and
// a human readable error message.
err = status.Error(storepb.GRPCCodeFromWarn(warn), at.GetWarning())
return
}
Expand Down

0 comments on commit 9f4f13a

Please sign in to comment.