github-actions[bot] commented on code in PR #67661:
URL: https://github.com/apache/doris/pull/67661#discussion_r3957138004


##########
fe/fe-core/src/main/java/org/apache/doris/alter/RollupJobV2.java:
##########
@@ -708,8 +708,14 @@ protected boolean checkFailedPreviousLoadAndAbort() throws 
UserException {
         if (Config.enable_abort_txn_by_checking_conflict_txn) {
             List<TransactionState> failedTxns = 
GlobalTransactionMgr.checkFailedTxns(unFinishedTxns);
             for (TransactionState txn : failedTxns) {
-                Env.getCurrentGlobalTransactionMgr()
-                        .abortTransaction(txn.getDbId(), 
txn.getTransactionId(), "Cancel by schema change");
+                try {
+                    Env.getCurrentGlobalTransactionMgr()
+                            .abortTransaction(txn.getDbId(), 
txn.getTransactionId(), "Cancel by schema change");
+                } catch (UserException e) {

Review Comment:
   [P1] Preserve callback cleanup when the abort loses the commit race
   
   A routine-load transaction can reach this catch after its callback has 
already acquired state that only the after-callback releases. Routine-load txns 
register the job as their transaction callback; local abort calls 
`beforeAborted` before its synchronized status check, and 
`RoutineLoadJob.beforeAborted` acquires the job write lock for `afterAborted` 
to release. If an in-flight commit changes the selected PREPARE txn to 
COMMITTED first, abort acquires that callback lock, then 
`unprotectAbortTransaction` throws, so `afterStateTransform`/`afterAborted` 
never runs. Returning false keeps the rollup alive but leaves routine-load 
publish and scheduler paths blocked on that lock, and later rounds skip 
COMMITTED so they cannot clean it up. Please make the local before/after abort 
callback pairing exception-safe (as the cloud path is) and add a 
callback-bearing race test; the new test uses callback ID -1 and cannot catch 
this leak.



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