-
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
chore: Fix regression in bloom gateway that caused nothing to be filtered #14807
Conversation
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.
LGTM
result = &logproto.GetChunkRefResponse{ | ||
Refs: make([]*logproto.ChunkRef, 0, len(chunks)), | ||
} | ||
for _, cs := range chunks { | ||
for i := range cs { | ||
result.Refs = append(result.Refs, &cs[i].ChunkRef) | ||
if _, ok := series[cs[i].Fingerprint]; !ok { | ||
series[cs[i].Fingerprint] = cs[i].Metric |
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: What about adding a comment in the chunk struct about fields not being populated until fetched?
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 also like this, it seems inevitable that someone is going to run into this again since it's not very obvious.
Pull request #14661 added the series labels to the FilterChunkRefs request in order to be able to filter out full series that do not contain the filter key when using bloom filters. However, this chage incorrectly assumed that `Chunk.Metric` from the `GetChunks()` call contains the labels of the stream. This information is only populated once the chunk is fetched, though. Therefore the list of labels was empty, and no chunk refs were filtered. Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
17a4ca5
to
5a0c481
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. |
…ered (#14807) Pull request #14661 added the series labels to the `FilterChunkRefs` request in order to be able to filter out full series that do not contain the filter key when using bloom filters. However, this change incorrectly assumed that `Chunk.Metric` from the `GetChunks()` call contains the labels of the stream. This information is only populated once the chunk is fetched, though. Therefore the list of labels was empty, and no chunk refs were filtered. Signed-off-by: Christian Haudum <christian.haudum@gmail.com> (cherry picked from commit 3b20cb0)
What this PR does / why we need it:
Pull request #14661 added the series labels to the
FilterChunkRefs
request in order to be able to filter out full series that do not contain the filter key when using bloom filters.However, this change incorrectly assumed that
Chunk.Metric
from theGetChunks()
call contains the labels of the stream. This information is only populated once the chunk is fetched, though. Therefore the list of labels was empty, and no chunk refs were filtered.Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
deprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR