zhangshenghang commented on PR #13337:
URL: https://github.com/apache/seatunnel/pull/13337#issuecomment-7231046860

   @DanielLeens — agreed: reading `count=1` in a constructor does not show that 
the budget survives a master replacement or that cleanup removes the new key. 
Plan for this PR:
   
   1. Replace the reflective `prepareRestorePipeline` invocation in 
`SubPlanTest` with the existing engine lifecycle, using the real failure path:
      - `JobRestoreIT` (container-based, already exercises restore) plus the 
deterministic `InMemorySinkFactory.THROW_RUNTIME_EXCEPTION_LIST` fixture, which 
fails on a configured restore count, so retries can be driven without timing 
luck;
      - restore retry budget 2, let the first failure consume one retry, 
restart the master with the same restart mechanism the cluster-restart restore 
IT uses, then fail again;
      - assert the second failure exhausts the budget (count=1 was persisted 
and read back, not reset to 0) instead of granting two fresh retries.
   2. Assert terminal cleanup removes the `PipelineRestoreInfo` key from 
`runningJobState` after the job ends, driven through the public cleanup path 
(`JobMaster.cleanJob` -> `JobCleanupRecord`), not by deleting the key in the 
test.
   3. Keep the documented limitation explicit: persistence is best-effort, so a 
failed write still logs that the budget may reset. The test proves the contract 
when the write succeeds.
   
   That keeps the responsibility split you named — `SubPlan` owns retry 
accounting, `JobMaster` owns job-state cleanup — and only replaces how it is 
verified.
   


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