Skip to content

[BUGFIX] PromQL: fix more slice indexing bugs in info function#17199

Merged
aknuds1 merged 2 commits intoprometheus:mainfrom
linasm:fix-more-info-function-bugs
Oct 23, 2025
Merged

[BUGFIX] PromQL: fix more slice indexing bugs in info function#17199
aknuds1 merged 2 commits intoprometheus:mainfrom
linasm:fix-more-info-function-bugs

Conversation

@linasm
Copy link
Contributor

@linasm linasm commented Sep 16, 2025

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 info function. This should easily compensate most of the performance overhead introduced with this PR.

Does this PR introduce a user-facing change?

[BUGFIX] PromQL: Fix slice indexing bug in info function on churning series.

@linasm linasm force-pushed the fix-more-info-function-bugs branch from e9620b8 to 6ce1485 Compare September 16, 2025 13:01
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except for the changelog change (please see my comment there).

Signed-off-by: Linas Medziunas <linas.medziunas@gmail.com>
@linasm linasm force-pushed the fix-more-info-function-bugs branch from 6ce1485 to 97c7d15 Compare October 23, 2025 14:13
@linasm linasm requested a review from aknuds1 October 23, 2025 14:30
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, but please see my perf related comment.

@linasm linasm force-pushed the fix-more-info-function-bugs branch from f561616 to 97c7d15 Compare October 23, 2025 14:49
Signed-off-by: Linas Medziunas <linas.medziunas@gmail.com>
@linasm linasm requested a review from aknuds1 October 23, 2025 14:50
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@aknuds1 aknuds1 merged commit 2081556 into prometheus:main Oct 23, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants