GWphua opened a new pull request, #19484: URL: https://github.com/apache/druid/pull/19484
### Description This PR fixes incorrect Peon sink-level query metric emission in SinkQuerySegmentWalker. 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. As a result, the following Peon metrics will be emitted with misleading values, making the three metrics appear identical: - query/segment/time - query/segmentAndCache/time - query/wait/time <img width="3330" height="1232" alt="image-20260519165853832" src="https://github.com/user-attachments/assets/a719ee59-6154-4e07-97d2-4f1855e16256" /> #### Release note Fix incorrect reporting of `query/segment/time`, `query/wait/time` and `query/segmentAndCache/time` on Peon. <hr> ##### Key changed/added classes in this PR * `SinkQuerySegmentWalker` <hr> <!-- Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items from the checklist below are strictly necessary, but it would be very helpful if you at least self-review the PR. --> This PR has: - [x] been self-reviewed. - [x] a release note entry in the PR description. - [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met. - [x] been tested in a test Druid cluster. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
