fix: Peon metrics emit same value#19484
Open
GWphua wants to merge 2 commits into
Open
Conversation
jtuglu1
approved these changes
May 20, 2026
Contributor
jtuglu1
left a comment
There was a problem hiding this comment.
Thanks. Will this test change catch any regressions as well?
Contributor
Author
|
Unfortunately, no. Will find some time to add that |
Contributor
Author
|
Hi @jtuglu1 I looked at trying to test the regression, but this may break abstraction. I am looking to bring these 3 lines of code into a function However, the Given that the fix removes the fall-through switch and replaces it with direct reporter-to-value calls, I think that it is ok to omit the tests. What do you think? |
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.
Description
This PR fixes incorrect Peon sink-level query metric emission in SinkQuerySegmentWalker. This bug exists since v32, introduced by #17170
The Bug
Currently, the following Peon metrics will be emitted with misleading values, making the three metrics appear identical:
Cause
The existing code iterated over METRICS_TO_REPORT and used a switch without break statements. Because reportMetric.getValue() is bound to the current metric reporter, fallthrough caused later accumulator values to be reported through the wrong reporter. For example, the query/segment/time reporter could be called with segment time, then wait time, then segment-and-cache time before emit(). Since DefaultQueryMetrics stores metric values by metric name before emission, the last value overwrote earlier ones.
Release note
Fix incorrect reporting of
query/segment/time,query/wait/timeandquery/segmentAndCache/timeon Peon.Key changed/added classes in this PR
SinkQuerySegmentWalkerThis PR has: