-
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
refactor: Limit processing of blocks to requested fingerprint ranges in bloom gateway #11987
Conversation
pkg/bloomgateway/util_test.go
Outdated
v1.NewBounds(0, 2), | ||
v1.NewBounds(5, 19), | ||
v1.NewBounds(25, 29), | ||
}, |
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.
nit: add a test where there is no overlap but the comparison is between the other two:
mb := bounds(0,10) + bounds (30,40)
target = bounds(15,25)
pkg/bloomgateway/util.go
Outdated
|
||
type MultiFingerprintBounds []v1.FingerprintBounds | ||
|
||
func (mb MultiFingerprintBounds) Union(target v1.FingerprintBounds) MultiFingerprintBounds { |
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 think for this to behave as expected, the multi-bounds must be
a) sorted already
b) contain disjoint (non-overlapping) ranges
Otherwise you can end up with many overlapping ranges in the result set as well.
Consider:
multi = [(0,6), (5,15)]
target = (8,10)
result = [(0,6), (5,15)] // can be further reduced
Thinking about it, it's probably not a real concern we have if we can ensure the multi-bounds are ordered and non overlapping.
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 solved the issue by using a different algorithm.
This PR limits the amount of data being processed for a single multiplexed iteration to the union of the fingerprint bounds of its requests, instead of looking at blocks from the complete fingerprint range. Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
e29534d
to
c8fc064
Compare
…in bloom gateway (grafana#11987) This PR limits the amount of data being processed for a single multiplexed iteration to the union of the fingerprint bounds of its requests, instead of looking at blocks from the complete fingerprint range. Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
…in bloom gateway (grafana#11987) This PR limits the amount of data being processed for a single multiplexed iteration to the union of the fingerprint bounds of its requests, instead of looking at blocks from the complete fingerprint range. Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
What this PR does / why we need it:
This PR limits the amount of data being processed for a single multiplexed iteration to the union of the fingerprint bounds of its requests, instead of looking at blocks from the complete fingerprint range.