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


##########
fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadJob.java:
##########
@@ -1353,6 +1353,15 @@ public void afterAborted(TransactionState txnState, 
boolean txnOperated, String
                     }
                     // TODO(ml): use previous be id depend on change reason
                 }
+                if (txnStatusChangeReason != 
TransactionState.TxnStatusChangeReason.NO_PARTITIONS) {

Review Comment:
   [P1] Keep timeout recovery independent of daemon ordering
   
   The transaction deadline starts in `beginTxn()`, but the task timer starts 
only after task creation and a successful BE submit. In shared-nothing mode the 
independent transaction cleaner can therefore abort the still-listed PREPARE 
transaction first with `timeout by txn manager`; this new branch then pauses 
and clears the whole job. If the 10-second routine scheduler wins instead, 
`processTimeoutTasks()` explicitly renews only that task while keeping the job 
running. Repeated cleaner-first timeouts also inherit auto-resume backoff up to 
five minutes, so recovery now depends on daemon timing. Preserve the 
renew-in-place behavior for transaction-manager task timeouts (or serialize 
timeout ownership), and add a cleaner-first test.



##########
fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadJob.java:
##########
@@ -1353,6 +1353,15 @@ public void afterAborted(TransactionState txnState, 
boolean txnOperated, String
                     }
                     // TODO(ml): use previous be id depend on change reason
                 }
+                if (txnStatusChangeReason != 
TransactionState.TxnStatusChangeReason.NO_PARTITIONS) {
+                    String msg = "be " + taskBeId + " abort task,"
+                            + " task id: " + routineLoadTaskInfo.getId()
+                            + " job id: " + routineLoadTaskInfo.getJobId()
+                            + " with reason: " + txnStatusChangeReasonString;
+                    updateState(JobState.PAUSED,

Review Comment:
   [P1] Make the abort-triggered pause replay-equivalent
   
   The ABORTED transaction record is persisted or enqueued before 
`afterStateTransform()` invokes this callback, while this PAUSED transition is 
a later, separate routine-load journal record. A leader failure after the abort 
becomes durable but before the second record leaves a valid replay prefix where 
`replayOnAborted()` restores only progress/statistics and never this 
`TASKS_ABORT_ERR` state, so the job can recover in its prior state instead of 
preserving the new pause behavior. The same ordering exists when the cloud meta 
service completes the abort before the local callback. Make the transition 
recoverable and idempotent from the abort record (or atomic with it), and add a 
failover/replay test for that prefix.



##########
regression-test/suites/load_p0/routine_load/test_routine_load_be_restart.groovy:
##########
@@ -73,18 +73,20 @@ suite("test_routine_load_be_restart","nonConcurrent") {
                 RoutineLoadTestUtils.sendTestDataToKafka(producer, 
kafkaCsvTopics)
                 GetDebugPoint().enableDebugPointForAllFEs(injection_abort_txn)
                 RoutineLoadTestUtils.waitForTaskAbort(runSql, job, 60)
+                def pausedJob = sql "show routine load for ${job}"

Review Comment:
   [P1] Observe the paused reason in the polling snapshot
   
   `waitForTaskAbort()` returns from a prior `SHOW` based only on 
`abortedTaskNum`; it neither requires PAUSED nor returns that row. Because 
`TASKS_ABORT_ERR` is auto-resumable, the routine scheduler can move the job to 
`NEED_SCHEDULE`/`RUNNING` between the helper's snapshot and this second query, 
making the new assertion fail on correct recovery. Poll PAUSED, `errCode = 
104`, and the coordinator-restart message from one `SHOW` result (and then 
disable the injection) instead of checking state in a separate snapshot.



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