SEPURI-SAI-KRISHNA commented on issue #13324:
URL: https://github.com/apache/seatunnel/issues/13324#issuecomment-7221413943

   Thanks both. Revised contract, read on dev `4cc5a10f4a`; the test below must 
prove it.
   
   **Records.** `completePendingCheckpoint` stores every checkpoint before 
`notifyCompleted` except `COMPLETED_POINT` (`notCompletedCheckpoint()`), so 
after the final commit only the IMap status says the pipeline ended.
   - R1, intent: store the final checkpoint before `notifyCompleted`, as 
savepoints already are.
   - R2, done: FINISHED or SUSPEND in the IMap after `notifyCompleted` 
returned, as today.
   
   **Replacement master, pipeline not ended:**
   1. R2 present: commit done. `forcePipelineFinish`, keep R2 and the completed 
future, no RUNNING write, no trigger.
   2. R1 latest, R2 missing: in doubt, the old master may have died inside 
`notifyCompleted`. Restore only from R1, never an earlier checkpoint: 
committers re-commit it (`restoreCommit`, `allTaskReady` re-notify), the 
idempotent commit every restore relies on, and sources resume at R1. It then 
ends with a new final checkpoint; a job in `DOING_SAVEPOINT` takes its 
savepoint at once and ends SUSPEND.
   3. No R1: no final commit was issued, restore as today.
   
   **Second failure.** If R2 cannot be written (30 x 2 s for 
`isOperationNeedRetryException`, others at once), the coordinator completes 
FAILED naming the key, status and cause, instead of logging and completing 
FINISHED. R1 is kept (`clearCheckpointIfNeed` deletes only for FINISHED and 
CANCELED), so any later restore, on any master, is case 2 again. If R1 cannot 
be stored, nothing is notified and the checkpoint fails.
   
   **Per status.** FINISHED: R1 is the `COMPLETED_POINT`. SUSPEND: R1 is the 
savepoint. FAILED, CANCELED: no final commit follows, so a lost write is case 
3. Plain committers re-commit in case 2 only once #13469 is fixed.
   
   **Test,** two nodes in `CoordinatorServiceTest` as 
`testJobRestoreWhenMasterNodeSwitch`: batch FakeSource to a sink whose 
aggregated committer records commits. An IMap interceptor rejects the FINISHED 
write; stop the master after the final commit, before cleanup. Assert exact 
rows (none read again), the final commit applied, FINISHED on the new master. 
Variant with R2 written while the pipeline is RUNNING in the IMap: no RUNNING 
write, no checkpoint. Plus retryable and non-retryable injections.
   
   One choice: case 2 runs the pipeline once more to re-commit (the test must 
show no source rows). Or it ends FAILED, keeping R1 for a manual restore: never 
runs again, but can leave a partial final commit. Which do you prefer?
   


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

Reply via email to