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

   ### Background
   
   The FE calls transaction callbacks before and after aborting a load or 
delete transaction. A Routine Load job uses those callbacks to acquire and 
release its write lock. A committed DELETE still needs its callback when the 
transaction becomes visible, so the FE can record the finished job.
   
   ### What problem does this PR solve?
   
   Issue Number: #69961
   Related PR: #70178 (master fix), #3369 (local abort callback boundary), 
#3515 (DELETE callback cleanup)
   PR Type: Bugfix
   
   Problem Summary:
   
   In branch-4.1, a local abort callback can mask the original abort error. A 
rejected abort also removes a committed DELETE's callback from the registry. 
One rejection can still publish through the cached callback, but a retry clears 
that cache and leaves the DELETE missing from the job history. Keep the 
original abort outcome and retain the DELETE callback through publication. Most 
of the diff is FE unit tests.
   
   ### Details
   
   - **Frequency:** Reproduced in focused FE unit tests for a throwing after 
callback and two abort attempts before the committed DELETE becomes visible. 
Production frequency is unknown.
   - **Root cause:** Both local abort entry points run the after callback in a 
`finally` block. A callback failure can replace the exception already 
propagating from the transaction operation. On a retried abort, the callback 
lookup replaces the cached DELETE callback with null after the first attempt 
removed its registration.
   - **Why existing tests missed it:** The existing transaction suites did not 
combine a rejected abort with a throwing callback or retry cancellation before 
publishing a committed DELETE. DELETE regression tests cover normal SQL results 
without forcing this ordering.
   - **Fix:** Log after-callback failures after releasing the database write 
lock, as on commit and publish. Keep a local DELETE callback until the 
transaction becomes `ABORTED` or the publish callback finishes.
   - **Other paths and branches:** The fix covers normal and 2PC local abort. 
Branch-4.1 already pairs Routine Load callbacks after unlocking. Cloud DELETE 
cleanup continues even if Meta Service already aborted the transaction.
   - **Behavior change:** When only the after callback throws, a successful 
local abort returns success and logs the callback error.
   
   ### Testing
   
   - Ran `DatabaseTransactionMgrTest` and `CloudGlobalTransactionMgrTest` with 
`./run-fe-ut.sh --run` on macOS ARM64 using JDK 17. On the branch-4.1 baseline, 
both rejection tests got `IllegalStateException` from the callback, and the 
DELETE publish test recorded zero finished jobs after a retry. All 56 cases 
passed with the backport.
   - The suites also verify Routine Load lock release after rejection and an 
injected edit-log failure, DELETE publication after a single rejected abort, 
local DELETE callback cleanup, and cloud cleanup after both `OK` and 
`TXN_ALREADY_ABORTED`. The cloud cases mock Meta Service responses.
   
   ### Notes for Reviewers
   
   Branch-4.1 sets `ABORTED` before writing the edit log inside the database 
lock. A write failure leaves that state in memory even though `txnOperated` is 
false. Local DELETE cleanup therefore checks the transaction status.
   
   ### Release note
   
   Rejected local aborts report the original transaction error. A committed 
DELETE still appears in the delete history after a cancellation retry and 
successful publication.
   
   ### Check List (For Author)
   
   - Behavior changed: Yes (see Details)
   - Does this need documentation: No
   - Pre-submission status: Ready
   
   ### AI Disclosure
   
   - Tool: Codex (GPT-6)
   - Generated: Backport conflict resolution, FE unit test adaptations, and PR 
description.
   - Human review: not stated
   


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