-
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
fix(blooms): dont break iterator conventions #12808
fix(blooms): dont break iterator conventions #12808
Conversation
refactors skip logic for bloom pages that are too large s/Seek/LoadOffset/ for LazyBloomIter removes unused code Signed-off-by: Owen Diehl <[email protected]>
adbbaf0
to
3ca36fa
Compare
pkg/storage/bloom/v1/block.go
Outdated
@@ -144,14 +144,12 @@ func (bq *BlockQuerier) Seek(fp model.Fingerprint) error { | |||
func (bq *BlockQuerier) Next() bool { | |||
for bq.series.Next() { | |||
series := bq.series.At() | |||
bq.blooms.Seek(series.Offset) | |||
if ok := bq.blooms.LoadOffset(series.Offset); !ok { |
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 LoadOffset should return an error. Then we should check here if the error is due to the page being too big in which case we can safely continue. Otherwise, we wont be able to error when there is. for example, an IO error.
fq.bq.blooms.Seek(series.Offset) | ||
ok := fq.bq.blooms.LoadOffset(series.Offset) | ||
if !ok { | ||
// could not seek to the desired bloom, |
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.
Same as previous comment
Good points @salvacorts -- I inverted the logic and now // LoadOffset returns whether the bloom page at the given offset should
// be skipped (due to being too large) _and_ there's no error
func (it *LazyBloomIter) LoadOffset(offset BloomOffset) (skip bool) It'll only return true when it's safe to skip so other times the error will surface immediately after. |
638b3e5
to
5575682
Compare
Signed-off-by: Owen Diehl <[email protected]>
5575682
to
fc6554b
Compare
This PR must be merged before a backport PR will be created. |
1 similar comment
This PR must be merged before a backport PR will be created. |
Followup to #12806 which exposes skipped pages more explicitly than as an error. * refactors skip logic for bloom pages that are too large * s/Seek/LoadOffset/ for LazyBloomIter * removes unused code
Followup to #12806 which exposes skipped pages more explicitly than as an error.