Skip to content

Commit

Permalink
fixup! Bloom Gateway: Partition requests into multiple tasks
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Haudum <[email protected]>
  • Loading branch information
chaudum committed Jan 24, 2024
1 parent 42ec9ca commit 5168b07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions pkg/bloomgateway/bloomgateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,7 @@ func (g *Gateway) FilterChunkRefs(ctx context.Context, req *logproto.FilterChunk
expectedResponses += len(seriesWithBounds.series)
}

// no chunks in bounds => empty response
if req.From.Equal(req.Through) {
if len(tasks) == 0 {
return &logproto.FilterChunkRefResponse{
ChunkRefs: []*logproto.GroupedChunkRefs{},
}, nil
Expand Down
6 changes: 3 additions & 3 deletions pkg/bloomgateway/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ func (w *worker) running(ctx context.Context) error {
continue
}

boundedRefs := partitionFingerprintRange(tasks, blockRefs)
tasksForBlocks := partitionFingerprintRange(tasks, blockRefs)
blockRefs = blockRefs[:0]
for _, b := range boundedRefs {
for _, b := range tasksForBlocks {
blockRefs = append(blockRefs, b.blockRef)
}

err = w.processBlocksWithCallback(taskCtx, tasks[0].Tenant, day, blockRefs, boundedRefs)
err = w.processBlocksWithCallback(taskCtx, tasks[0].Tenant, day, blockRefs, tasksForBlocks)
if err != nil {
for _, t := range tasks {
t.ErrCh <- err
Expand Down

0 comments on commit 5168b07

Please sign in to comment.