-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add e2e tests for bloom filtering #11645
Conversation
Signed-off-by: Christian Haudum <[email protected]>
Signed-off-by: Christian Haudum <[email protected]>
Signed-off-by: Christian Haudum <[email protected]>
Signed-off-by: Christian Haudum <[email protected]>
A test that both builds bloom filters as well as uses them for filtering chunk refs when querying. Signed-off-by: Christian Haudum <[email protected]>
Signed-off-by: Christian Haudum <[email protected]>
Signed-off-by: Christian Haudum <[email protected]>
Signed-off-by: Christian Haudum <[email protected]>
Signed-off-by: Christian Haudum <[email protected]>
Signed-off-by: Christian Haudum <[email protected]>
Signed-off-by: Christian Haudum <[email protected]>
f408ceb
to
f55d79b
Compare
Signed-off-by: Christian Haudum <[email protected]>
Signed-off-by: Christian Haudum <[email protected]>
// isOutsideRange tests if a given BlockRef b is outside of search boundaries | ||
// defined by min/max timestamp and min/max fingerprint. | ||
// Fingerprint ranges must be sorted in ascending order. | ||
func isOutsideRange(b *BlockRef, startTimestamp, endTimestamp model.Time, fingerprints [][2]uint64) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would create a struct, maybe FpRange
and pass []FpRange
into this function. it would make the code more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See commit db61f73
Signed-off-by: Christian Haudum <[email protected]>
Signed-off-by: Christian Haudum <[email protected]>
// this is already covered in the range check above, but I keep it as a second gate | ||
if idx > len(fingerprints)-1 { | ||
return true | ||
prev := fpRange{0, 0} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be written as
prev := fpRange{0, 0} | |
var prev fpRange |
**What?** This PR adds an end-to-end integration test for creating bloom filters and using them in the gateway to filter chunks. **Why?** This test helped to identify bugs in the bloom shipper code that would have taken a very long time to discover in other ways, such as deploying to a dev environment or running a long-running docker compose setup. **Notes** The following commits of this PR are actual changes to the compactor/gateway code to make e2e test work: * grafana@2dcc761 * grafana@84052dd * grafana@3ba44f8 The bloom gateway code path for processing blocks was cleaned up, because it still contained the unused "sequention processing" path of blocks, which was initially kept to verify the callback based processing works alike: * grafana@f55d79b --------- Signed-off-by: Christian Haudum <[email protected]>
What?
This PR adds an end-to-end integration test for creating bloom filters and using them in the gateway to filter chunks.
Why?
This test helped to identify bugs in the bloom shipper code that would have taken a very long time to discover in other ways, such as deploying to a dev environment or running a long-running docker compose setup.
Notes
The following commits of this PR are actual changes to the compactor/gateway code to make e2e test work:
The bloom gateway code path for processing blocks was cleaned up, because it still contained the unused "sequention processing" path of blocks, which was initially kept to verify the callback based processing works alike: