zhangshenghang opened a new pull request, #13484:
URL: https://github.com/apache/seatunnel/pull/13484

   Do. This change adds Zeta engine E2E coverage only; no product code is 
modified.
   
   ### What this adds
   
   `CancelledJobCheckpointRetentionIT` plus two fixtures that differ only in 
the per-job
   `env.checkpoint.retain-after-job-cancelled` switch. One in-JVM master/worker 
cluster with
   local-file checkpoint storage in a private directory runs both jobs:
   
   1. the job that opts in is cancelled; its checkpoint data must still be 
readable through
      `JobClient#getCheckpointData` and must still exist in the checkpoint 
store after the job's
      master has been fully cleaned up;
   2. a sibling job on the same cluster that does not set the option is 
cancelled; its checkpoint
      data must be gone, and the first job's retained data must be untouched — 
this pins that the
      decision is per job rather than per cluster;
   3. the retained data must be a real recovery point: a 
`RestoreMode#CHECKPOINT` restore with the
      cancelled job as source and a new destination job id reaches `RUNNING` 
and completes a
      checkpoint whose id is above the retained one.
   
   ### Why this boundary needs coverage
   
   `JobMaster#cleanJob` calls `CheckpointManager#clearCheckpointIfNeed`, which 
deletes every
   checkpoint of a cancelled job unless the job asked to keep them. Both 
failure modes are silent:
   if the option is ignored, the only data a later `--restore-with-checkpoint` 
could resume from is
   lost and the restore silently starts from scratch; if the option leaks, 
every cancelled job keeps
   its checkpoint data forever. Neither changes anything the client can observe 
— both jobs report
   `CANCELED`.
   
   Existing coverage stops short of this contract: `CheckpointManagerTest`, 
`JobMasterTest` and
   `CoordinatorServiceJobCleanupTest` assert the delete/skip decision against 
stubbed storage, and
   `CheckpointRestoreWithStopIT` drives only the opt-in side through the CLI in 
a Testcontainers
   cluster. Nothing asserts the default (delete) branch, nothing checks that 
retention is scoped to
   the job that asked for it, and nothing proves the retained bytes are 
loadable.
   
   The checkpoint-id assertion is the loadability proof: `CheckpointManager` 
seeds the checkpoint-id
   counter with `retainedId + 1` only when it actually read the retained 
pipeline state, so a restore
   that fell back to a fresh start would number its first checkpoint from 1 and 
fail the test.
   
   ### Verification
   
   ```
   ./mvnw -o -pl 
seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base spotless:apply
   ./mvnw -o -pl 
seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base verify \
     -DskipUT=true -DskipIT=false -Dit.test=CancelledJobCheckpointRetentionIT \
     -Dfailsafe.failIfNoSpecifiedTests=false
   ```
   
   Result: `Tests run: 1, Failures: 0, Errors: 0, Skipped: 0` (BUILD SUCCESS), 
including the
   module's spotless check.
   
   Related: checkpoint-based restore was introduced in #11421; this test guards 
the cancellation
   lifecycle around that recovery point.
   


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