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

   ### Background
   
   Parallel BE pipeline tasks share operator and expression objects while 
maintaining task-local execution state.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: None
   PR Type: Bugfix
   
   Problem Summary:
   
   ThreadSanitizer reported conflicting accesses during aggregation and join 
queries. This PR addresses three shared-state races in Hash Join, expression 
initialization, and Exchange cleanup.
   
   ### Details
   
   - **Frequency:** Reproduced with parallel BE tasks during a TSan SQL smoke 
run.
   - **Root cause:** Hash Join tasks modified the same column-retention state, 
expression contexts wrote an open flag on shared expression nodes, and Exchange 
tasks wrote an operator-level close flag.
   - **Why existing tests missed it:** The smoke queries returned expected 
results while TSan detected the concurrent accesses.
   - **Fix:** Track key retention in each Hash Join build task and update a 
local copy of the column mask. Delete the shared expression open flag and its 
checks, preserving the initialization calls. Let Exchange use the inherited 
close path and its task-local cleanup state.
   - **Other paths and branches:** Updated reader tests to check context 
lifecycle and nested expression initialization. The changes target master.
   
   ### Testing
   
   - Remote ASAN BE build using `BUILD_TYPE=ASAN ./build.sh --be -j48`.
   - clang-format 16 and BE build hygiene checks.
   - The original races were observed before the fix. Post-fix TSan runtime 
validation and unit tests have not been run.
   
   ### Release note
   
   Fix three BE data races in Hash Join, expression initialization, and 
Exchange cleanup.
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Partially verified: BE build and static checks, 
with runtime validation pending.
   
   ### AI Disclosure
   
   - Tool: Codex
   - Generated: Code changes and PR description
   - Human review: The requester reviewed the local changes before authorizing 
submission.
   


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