dybyte commented on code in PR #10567:
URL: https://github.com/apache/seatunnel/pull/10567#discussion_r2917012753
##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/physical/PhysicalVertex.java:
##########
@@ -206,6 +206,18 @@ public PassiveCompletableFuture<TaskExecutionState>
initStateFuture() {
public void restoreExecutionState() {
startPhysicalVertex();
+ // Re-sync currExecutionState from IMap before processing. During
master failover,
+ // IMap may still say DEPLOYING if the master crashed after the worker
finished
+ // deploying but before the master processed NotifyTaskStatusOperation
and updated
+ // the IMap to RUNNING. In that case, check whether the task is
actually executing
+ // on the worker and advance the state to RUNNING so stateProcess()
does not send
+ // a redundant DeployTaskOperation.
+ this.currExecutionState = (ExecutionState)
runningJobStateIMap.get(taskGroupLocation);
+ if (ExecutionState.DEPLOYING.equals(currExecutionState)) {
+ if (checkTaskGroupIsExecuting(taskGroupLocation)) {
+ updateTaskState(ExecutionState.RUNNING);
+ }
+ }
Review Comment:
Thanks for the explanation. Since we still need a network round-trip to
detect the real state anyway, Fix 2 seems to add redundant complexity.
I'd prefer to keep the PR minimal and remove Fix 2, relying on the
idempotency of `deployTask()`.
--
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]