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

   Yes, I am contributing to Apache SeaTunnel.
   
   ### Purpose of this pull request
   
   Adds an E2E regression guard for the **in-place pipeline restore** path: a 
pipeline whose task fails at runtime while its `job.retry.times` budget is not 
exhausted must be restored alone, without failing the job and without touching 
an already FINISHED sibling pipeline.
   
   `SubPlan#stateProcess` (case `FAILED`) calls `checkNeedRestore()` and, while 
budget remains, runs `prepareRestorePipeline()` + `restorePipeline()` and 
returns early. Because the pipeline future is never completed, 
`PhysicalPlan#addPipelineEndCallback` never observes the failure. Two 
observable invariants follow:
   
   | invariant | why it matters |
   |---|---|
   | the job-level status never becomes 
`FAILING`/`FAILED`/`CANCELED`/`SAVEPOINT_DONE`; the job stays `RUNNING` while 
the pipeline is restored | a recoverable pipeline failure is not a job failure. 
Reporting one defeats the remaining `job.retry.times` budget and makes the 
engine cancel every other pipeline of the job |
   | an already FINISHED sibling keeps `pipelineRestoreNum == 0` and its 
committed row count | redeploying a finished batch sibling replays its output, 
so a failure in an unrelated pipeline would change the job's committed data |
   
   ### What the test does
   
   New `testRecoverablePipelineFailureRestoresOnlyThatPipeline` in the existing 
`ClusterFaultToleranceTwoPipelineIT` (one in-JVM Zeta node, batch job, two 
independent pipelines):
   
   - `table_healthy` is an ordinary bounded `FakeSource -> LocalFile` pipeline 
that finishes within a couple of seconds.
   - `table_flaky`'s test-only sink 
(`siblingrestore/RetryableFailureTestSink*`) parks on its very first row until 
the test has observed `table_healthy` FINISHED, then throws **exactly once**. 
The later (restored) attempt behaves like a normal sink. The injected failure 
therefore cannot race the sibling's own completion, so the ordering is 
deterministic rather than sleep-based.
   - The test samples `ClientJobProxy#getJobStatus()` every 100 ms for the 
whole run and then asserts: job `RUNNING` when the sibling finishes; exactly 
one restore attempt on `table_flaky`; `table_healthy` still `FINISHED` with 
restore count 0 and unchanged row count while the restore happens; job ends 
`FINISHED`; no failing/stopping job status was ever reported.
   
   ### Why the existing coverage does not reach it
   
   - `ClusterFaultToleranceTwoPipelineIT` and `SplitClusterFaultToleranceIT` 
restore pipelines only after a **worker or the master is lost** 
(`*RestoreInWorkerDown`, `*RestoreInMasterDown`); none of them injects a 
recoverable task failure and inspects the sibling.
   - `testOneUnrecoverablePipelineForceCancelsHealthySiblingPipeline` documents 
the opposite, terminal path: the restore budget is exhausted and every pipeline 
(including the healthy one) is cascade-cancelled.
   - `CheckpointErrorRestoreEndTest` / `JobRuntimeDiagnosticsTest` are 
unit-level and never drive a real two-pipeline job.
   
   ### Verification
   
   On `dev` `1e7e29a75b`:
   
   ```
   ./mvnw -o -pl 
seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base \
     -DskipUT=true -DskipIT=false \
     
-Dit.test='ClusterFaultToleranceTwoPipelineIT#testRecoverablePipelineFailureRestoresOnlyThatPipeline'
 \
     -DfailIfNoTests=false verify
   ```
   
   Three consecutive green runs: 17.0s, 17.1s, 17.2s.
   
   Negative control: disabling the in-place restore branch in 
`SubPlan#stateProcess` (`if (false && checkNeedRestore(state) && 
prepareRestorePipeline())`, built through the reactor) fails the new test in 
133.7s with
   `The failed pipeline was not restored: state=FAILED, restoreNum=0`. Mutation 
reverted (engine sources unchanged) and the test is green again.
   
   `spotless:check` exit 0; `ImportClassCheckTest` exit 0; `git diff --check` 
exit 0.
   
   Test-only change; no engine or business logic is modified.
   


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