|
|
|
@ -384,6 +384,10 @@ func (s *SimpleBloomController) buildGaps( |
|
|
|
|
// to try and accelerate bloom creation
|
|
|
|
|
level.Debug(logger).Log("msg", "loading series and blocks for gap", "blocks", len(gap.blocks)) |
|
|
|
|
seriesItr, blocksIter, err := s.loadWorkForGap(ctx, table, tenant, plan.tsdb, gap) |
|
|
|
|
if err != nil { |
|
|
|
|
level.Error(logger).Log("msg", "failed to get series and blocks", "err", err) |
|
|
|
|
return nil, errors.Wrap(err, "failed to get series and blocks") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TODO(owen-d): more elegant error handling than sync.OnceFunc
|
|
|
|
|
closeBlocksIter := sync.OnceFunc(func() { |
|
|
|
@ -393,11 +397,6 @@ func (s *SimpleBloomController) buildGaps( |
|
|
|
|
}) |
|
|
|
|
defer closeBlocksIter() |
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
level.Error(logger).Log("msg", "failed to get series and blocks", "err", err) |
|
|
|
|
return nil, errors.Wrap(err, "failed to get series and blocks") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Blocks are built consuming the series iterator. For observability, we wrap the series iterator
|
|
|
|
|
// with a counter iterator to count the number of times Next() is called on it.
|
|
|
|
|
// This is used to observe the number of series that are being processed.
|
|
|
|
|