fix(blooms): Remove blocks not matching any series in task (#12401)

pull/12402/head^2
Salva Corts 2 years ago committed by GitHub
parent d972ce0f2d
commit cf71ac7114
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      pkg/bloomgateway/processor.go
  2. 2
      pkg/bloomgateway/util.go
  3. 20
      pkg/bloomgateway/util_test.go

@ -175,7 +175,7 @@ func (p *processor) processBlock(_ context.Context, blockQuerier *v1.BlockQuerie
if sp := opentracing.SpanFromContext(task.ctx); sp != nil {
md, _ := blockQuerier.Metadata()
blk := bloomshipper.BlockRefFrom(task.Tenant, task.table.String(), md)
sp.LogKV("process block", blk.String())
sp.LogKV("process block", blk.String(), "series", len(task.series))
}
it := v1.NewPeekingIter(task.RequestIter(tokenizer))

@ -78,7 +78,7 @@ func partitionTasks(tasks []Task, blocks []bloomshipper.BlockRef) []blockWithTas
})
// All fingerprints fall outside of the consumer's range
if min == len(refs) || max == 0 {
if min == len(refs) || max == 0 || min == max {
continue
}

@ -136,6 +136,26 @@ func TestPartitionTasks(t *testing.T) {
require.Len(t, res.tasks[0].series, 90)
}
})
t.Run("block series before and after task series", func(t *testing.T) {
bounds := []bloomshipper.BlockRef{
mkBlockRef(100, 200),
}
tasks := []Task{
{
series: []*logproto.GroupedChunkRefs{
{Fingerprint: 50},
{Fingerprint: 75},
{Fingerprint: 250},
{Fingerprint: 300},
},
},
}
results := partitionTasks(tasks, bounds)
require.Len(t, results, 0)
})
}
func TestPartitionRequest(t *testing.T) {

Loading…
Cancel
Save