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

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: #66102
   
   Problem Summary: Nullable aggregation hash tables previously published the 
null-key entry before its creator completed. If allocation or aggregate-state 
construction failed, cleanup could destroy uninitialized state. Delaying the 
null-key flag until the creator returns fixes that case, but the two LIMIT 
creators perform additional throwing work after aggregate-state construction. 
If top-N column insertion or heap maintenance throws, the flag remains 
unpublished while a live resource-owning aggregate state is left behind.
   
   This PR preserves delayed flag publication and gives the LIMIT null-key 
creators a strong exception guarantee. It adds an explicit commit/rollback 
boundary: construct into a local pointer, perform the post-construction LIMIT 
update, destroy the completed state if that update throws, and publish the 
mapped pointer only on success. It also retains value-initialized null storage 
and the mirrored StringHashMap publication order from #66102. Unit tests cover 
immediate creator failure, construction followed by post-create failure and 
rollback, and successful retry for ordinary nullable and StringHashMap batch 
paths.
   
   ### Release note
   
   Fix cleanup of nullable aggregation states when creation or 
post-construction LIMIT maintenance fails.
   
   ### Check List (For Author)
   
   - Test: Unit Test
       - `GLIBC_COMPATIBILITY=OFF ./run-be-ut.sh -j 48 --run 
--filter=HashTableMethodTest.*` (18/18 passed under ASAN_UT)
       - `build-support/check-format.sh`
       - `build-support/run-clang-tidy.sh --build-dir be/ut_build_ASAN`
   - Behavior changed: Yes. Failed null-key state creation is never published, 
and fully constructed state is rolled back if later LIMIT maintenance throws.
   - 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