Skip to content

Commit

Permalink
fixup! Implement PrefetchBloomBlocks gRPC method on gateway
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Haudum <[email protected]>
  • Loading branch information
chaudum committed Nov 21, 2024
1 parent 204acaa commit a90607d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pkg/bloomgateway/bloomgateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,27 @@ func (g *Gateway) PrefetchBloomBlocks(ctx context.Context, req *logproto.Prefetc
if err != nil {
return nil, err
}
_, err = g.bloomStore.FetchBlocks(
bqs, err := g.bloomStore.FetchBlocks(
ctx,
refs,
bloomshipper.WithFetchAsync(true),
bloomshipper.WithIgnoreNotFound(true),
)
if err != nil {
return nil, err
}

for _, bq := range bqs {
if bq == nil {
// This is the expected case: the blocks is not yet downloaded and the block querier is nil
continue
}

// Close any block querier that were already downloaded
if err := bq.Close(); err != nil {
level.Warn(g.logger).Log("msg", "failed to close block querier", "err", err)
}
}
return &logproto.PrefetchBloomBlocksResponse{}, err
}

Expand Down

0 comments on commit a90607d

Please sign in to comment.