[BUGFIX] PromQL: fix more slice indexing bugs in info function#17199
Merged
aknuds1 merged 2 commits intoprometheus:mainfrom Oct 23, 2025
Merged
[BUGFIX] PromQL: fix more slice indexing bugs in info function#17199aknuds1 merged 2 commits intoprometheus:mainfrom
aknuds1 merged 2 commits intoprometheus:mainfrom
Conversation
e9620b8 to
6ce1485
Compare
aknuds1
requested changes
Oct 23, 2025
Contributor
aknuds1
left a comment
There was a problem hiding this comment.
LGTM, except for the changelog change (please see my comment there).
Signed-off-by: Linas Medziunas <linas.medziunas@gmail.com>
6ce1485 to
97c7d15
Compare
aknuds1
reviewed
Oct 23, 2025
Contributor
aknuds1
left a comment
There was a problem hiding this comment.
Looks pretty good, but please see my perf related comment.
f561616 to
97c7d15
Compare
Signed-off-by: Linas Medziunas <linas.medziunas@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While fixing #17134, I missed the fact that there were two more loops that were accessing a wrong slice by loop index variable. In this PR, I have added two test cases that reproduce those bugs, and replaced loop index variable with metric hash for robust indexing.
I recognize that computing those hashes could affect performance, but IMHO there is no value in performance when the implementation is not correct. Besides, once we are done with #17143 optimizations, I will be able to port some of those improvements (hash memoization, primarily) to this promising experimental
infofunction. This should easily compensate most of the performance overhead introduced with this PR.Does this PR introduce a user-facing change?