chore(blooms): Remove excessive logging in fused querier (#14152)

The FusedQuerier emits a large amount of log lines at level WARN if a bloom is empty. Since the introduction of structured metadata blooms, this happens every time a series does not have structured metadata in any of its entries.

In the future, an optimisation could be to not write blooms for series at all, if they contain no data.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
pull/14153/head
Christian Haudum 8 months ago committed by GitHub
parent 78b275bf10
commit 6e36041c08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      pkg/storage/bloom/v1/bloom_tokenizer.go
  2. 4
      pkg/storage/bloom/v1/filter/scalable.go
  3. 18
      pkg/storage/bloom/v1/fuse.go

@ -112,7 +112,7 @@ func (bt *BloomTokenizer) Populate(blooms v2iter.SizedIterator[*Bloom], chks v2i
// We noticed some blooms are empty on the resulting blocks.
// We have the feeling that the empty blooms may be reused from old blocks.
// Here we log an error if we find an empty bloom.
if bloom.Count() == 0 {
if bloom.IsEmpty() {
level.Warn(bt.logger).Log("msg", "found existing empty bloom")
}
} else {
@ -149,7 +149,7 @@ func (bt *BloomTokenizer) Populate(blooms v2iter.SizedIterator[*Bloom], chks v2i
}
// TODO(salvacorts): Delete this once we solve the correctness bug
if bloom.Count() == 0 {
if bloom.IsEmpty() {
level.Warn(bt.logger).Log("msg", "resulting bloom is empty")
}

@ -116,6 +116,10 @@ func (s *ScalableBloomFilter) Count() (ct int) {
return
}
func (s *ScalableBloomFilter) IsEmpty() bool {
return s.Count() == 0
}
// FillRatio returns the average ratio of set bits across every filter.
func (s *ScalableBloomFilter) FillRatio() float64 {
var sum, count float64

@ -305,14 +305,18 @@ func (fq *FusedQuerier) runSeries(_ Schema, series *SeriesWithMeta, reqs []Reque
// Test each bloom individually
bloom := fq.bq.blooms.At()
// TODO(owen-d): this is a stopgap to avoid filtering broken blooms until we find their cause.
// This is a stopgap to avoid filtering on empty blooms.
// In the case we don't have any data in the bloom, don't filter any chunks.
if bloom.ScalableBloomFilter.Count() == 0 {
level.Warn(fq.logger).Log(
"msg", "Found bloom with no data",
"offset_page", offset.Page,
"offset_bytes", offset.ByteOffset,
)
// Empty blooms are generated from chunks that do not have entries with structured metadata.
if bloom.IsEmpty() {
// To debug empty blooms, uncomment the following block. Note that this may produce *a lot* of logs.
// swb := fq.bq.At()
// level.Debug(fq.logger).Log(
// "msg", "empty bloom",
// "series", swb.Fingerprint,
// "offset_page", offset.Page,
// "offset_bytes", offset.ByteOffset,
// )
for j := range reqs {
for k := range inputs[j].InBlooms {

Loading…
Cancel
Save