Skip to content

branch-4.0: [Profile][exec] The profile hitcache not correct in force refresh and sink id not correct #62645#62817

Open
github-actions[bot] wants to merge 1 commit intobranch-4.0from
auto-pick-62645-branch-4.0
Open

branch-4.0: [Profile][exec] The profile hitcache not correct in force refresh and sink id not correct #62645#62817
github-actions[bot] wants to merge 1 commit intobranch-4.0from
auto-pick-62645-branch-4.0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Cherry-picked from #62645

… sink id not correct (#62645)

 Two profile correctness issues were fixed:

1. **RESULT_SINK / OLAP_TABLE_SINK node_id incorrect**:
`ResultSinkOperatorX`,
`OlapTableSinkOperatorX`, and `OlapTableSinkV2OperatorX` were all
passing
`std::numeric_limits<int>::max()` (2147483647) as their `node_id`, so
the
profile showed `RESULT_SINK_OPERATOR(id=2147483647)` instead of a
meaningful
id. The fix derives `node_id` as `child_node_id + 1` (the `node_id` of
the
    last operator on the pipeline plus one), and threads it through the
    constructors, so the profile now displays a correct, readable id.

2. **CacheSourceOperator `HitCache` profile incorrect on
force-refresh**: When
`force_refresh_query_cache = true`, the cache is looked up but its
result is
intentionally discarded. Previously `HitCache` was set to `true` even in
this
case, misleading the profile. The fix moves the
`add_info_string("HitCache",
...)` call to after the `force_refresh` check, so the reported value
reflects
    whether the cache was actually *used*.

 ### Release note

 None

 ### Check List (For Author)

 - Test
- [x] Manual test (verified profile output shows correct node id and
       HitCache value)
 - Behavior changed:
- [x] Yes. Profile `id=` for RESULT_SINK / OLAP_TABLE_SINK operators now
shows a correct child node_id+1 instead of 2147483647. The `HitCache`
       profile field now correctly reports `false` when
       `force_refresh_query_cache=true`.
 - Does this need documentation?
     - [x] No.
@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Apr 24, 2026
@hello-stephen
Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 83.33% (15/18) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.96% (19211/35600)
Line Coverage 34.94% (173079/495396)
Region Coverage 29.33% (126180/430203)
Branch Coverage 30.70% (55629/181203)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants