BiteTheDDDDt opened a new pull request, #63256:
URL: https://github.com/apache/doris/pull/63256

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #49556, #61768, #62056, #60563
   
   Problem Summary: RQG on branch-4.1 can hit a BE SIGSEGV while publishing 
runtime filters from `HashJoinBuildSinkLocalState::close()`. The crash happens 
in `RuntimeFilterWrapper::set_state()` because the non-builder 
shared-hash-table runtime filter path can install a null shared wrapper.
   
   Root cause:
   1. Shared hash table broadcast joins keep runtime filter wrappers in 
`HashJoinBuildSinkOperatorX::_runtime_filters`.
   2. If the builder task is terminated early, it skips runtime filter 
`build()` and never fills the shared wrapper map.
   3. branch-4.1 still signaled non-builder tasks unconditionally from 
`close()`, so a non-builder could enter the shared runtime filter build path.
   4. That path used `DCHECK(runtime_filters.contains(...))` plus 
`runtime_filters[filter_id]`; in release builds the DCHECK is disabled and 
`operator[]` inserts a null `shared_ptr`.
   5. `RuntimeFilterProducer::set_wrapper_state_and_ready_to_publish()` then 
dereferences the null wrapper and crashes in 
`RuntimeFilterWrapper::set_state()`.
   
   This PR backports the relevant safety from #62056 and the defensive checks 
from #60563 for branch-4.1: only signal non-builder tasks when the builder was 
not terminated, and return an error instead of inserting/null-dereferencing a 
missing shared runtime filter wrapper.
   
   ### Release note
   
   Fixed a BE crash when publishing runtime filters for shared hash table hash 
joins.
   
   ### Check List (For Author)
   
   - Test: Manual test
       - build-support/check-format.sh
       - git diff --check
   - Behavior changed: No
   - Does this need documentation: No


-- 
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]

Reply via email to