-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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): Reset error on LazyBloomIter.Seek #12806
fix(blooms): Reset error on LazyBloomIter.Seek #12806
Conversation
@@ -45,6 +45,9 @@ func (it *LazyBloomIter) ensureInit() { | |||
func (it *LazyBloomIter) Seek(offset BloomOffset) { | |||
it.ensureInit() | |||
|
|||
// reset error from any previous seek/next | |||
it.err = nil |
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 don't think we should reset the error unconditionally, e.g we should not continue seeking after IO error.
Instead, we probably want to check the error type, similar to what the do here https://github.com/grafana/loki/pull/12297/files#diff-ad299f9ea738f6f6d8e1a3b9fcc651506b3a241dbfbd95a60ab9d96b5b8b4d4aR156
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.
Yes, I agree. Thank you!
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.
Otherwise LGTM
|
||
if fp == 0 || fp == 2 { | ||
require.False(t, querier.blooms.Next()) | ||
require.Error(t, querier.blooms.Err()) |
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.
Should we also check the error type here?
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. * refactors skip logic for bloom pages that are too large * s/Seek/LoadOffset/ for LazyBloomIter * removes unused code
What this PR does / why we need it:
We are skipping all pages after any of the pages on a given block have failed due to being too big:
Seek
a page that is too big.it.err
is set hereloki/pkg/storage/bloom/v1/bloom_querier.go
Lines 66 to 68 in feb210b
then
it.Next
returnfalse
in this checkloki/pkg/storage/bloom/v1/bloom_querier.go
Lines 87 to 89 in feb210b
Seek
another page that should be valid. Decoding of the new page succeeds butSeek
won’t resetit.err
. Therefore, the call toit.Next
returnfalse
again.This PR fixes this by resetting
it.err
on everySeek
.Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)docs/sources/setup/upgrade/_index.md
production/helm/loki/Chart.yaml
and updateproduction/helm/loki/CHANGELOG.md
andproduction/helm/loki/README.md
. Example PRdeprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR