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


##########
fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadJob.java:
##########
@@ -2033,6 +2036,11 @@ public void gsonPostProcess() throws IOException {
             }
         } catch (Exception e) {
             this.state = JobState.CANCELLED;
+            if (this.cancelReason == null) {

Review Comment:
   [P1] Preserve terminal invariants during post-processing
   
   For an active persisted job, `endTimestamp` is still -1 here. This block 
only assigns `state`/reason, so image cleanup later fails `isExpired()` on its 
final-state precondition. On `OP_CREATE_ROUTINE_LOAD_JOB` replay, the manager 
also registers this synthetic final job as a transaction callback and every 
later journaled state change is rejected because the job already appears 
`CANCELLED`; meanwhile an already `STOPPED` record is rewritten as a 
cancellation. Please handle the full state matrix: terminalize only active 
records with all required fields, preserve existing final states, and never 
register a final replayed job as a callback. A failing image/create-log replay 
test followed by later state/remove records would cover these invariants.



##########
fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadJob.java:
##########
@@ -242,7 +242,9 @@ public boolean isFinalState() {
     protected long autoResumeCount;
     // some other msg which need to show to user;
     protected String otherMsg = "";
+    @SerializedName("pauseReason")
     protected ErrorReason pauseReason;
+    @SerializedName("cancelReason")

Review Comment:
   [P1] Include cancellation reasons in the state-change journal
   
   This annotation only covers full-job snapshots. Normal cancellations go 
through `unprotectUpdateState`, whose non-`PAUSED` branch logs `new 
RoutineLoadOperation(id, jobState)` without `reason`; follower replay then 
passes null to `executeCancel`, so a promotion before the next checkpoint still 
makes `ReasonOfStateChanged` empty. This is distinct from the resolved 
`RoutineLoadJob.write()` discussion because this incremental EditLog path never 
serializes the full job. Please carry the reason for `CANCELLED` operations and 
cover operation serialization/replay plus failover in the test.



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