zhangshenghang opened a new pull request, #13740:
URL: https://github.com/apache/seatunnel/pull/13740
### Purpose of this pull request
Yes, I am contributing to Apache SeaTunnel.
Adds a Zeta engine E2E regression test for the terminal contract of a
**force stop that arrives while a multi-pipeline job is only half-way through a
savepoint**.
A savepoint is a job-wide operation: until every pipeline of the job stores
its part, the job has no usable savepoint. `PhysicalPlan#stopJob()` therefore
has a dedicated `DOING_SAVEPOINT` branch: pipelines that already stored their
savepoint part are finished, the remaining pipelines have their checkpoint
coordinator cancelled and are force-stopped, and the job must end `CANCELED`
because no savepoint was ever completed. If that decision regresses, the engine
reports `SAVEPOINT_DONE` for a savepoint that is missing one pipeline's state,
or leaves a half-done savepoint restorable — both hand operators a recovery
point that silently loses or duplicates data.
**What the test pins down (`ForceStopDuringPartialSavepointIT`, in-JVM Zeta
hybrid node, fixed slots, two independent streaming `FakeSource` pipelines):**
1. The window is made deterministic: `checkpoint.interval` is far beyond the
test duration, so the only barrier is the client savepoint; `pipeline-1`'s test
sink acknowledges it, `pipeline-2`'s sink parks inside
`SinkWriter#snapshotState(long)` and ignores interrupts. The test waits until
exactly `pipeline-1`'s savepoint part is durably stored and `pipeline-2` has
nothing stored.
2. The job is force-stopped through the real client
(`JobClient#cancelJob(jobId, true)`) while that barrier is still unacknowledged.
3. Contract: the job reaches `CANCELED` (never `SAVEPOINT_DONE`) while the
barrier is parked; the in-flight savepoint request settles as a failure with
the engine cause; releasing the late barrier neither revives the job nor
retries the savepoint (no second barrier on either sink).
4. The retained checkpoint data exposes only the partial savepoint part; a
client savepoint restore of that job is rejected by the per-pipeline
completeness check **before any job is submitted** (no new job master, no
rewritten savepoint parts), and the terminal job id stays `CANCELED`.
5. Both fixed slots are released: a replacement two-pipeline job reaches
`RUNNING` and cancels cleanly to `CANCELED`.
**Why existing coverage missed it**
* `CancelDuringSavepointIT` (#13456, open) cancels a single-pipeline job
*gracefully*; it never enters the force-stop path.
* `SavepointSnapshotFailureIT` (#13585) fails a single-pipeline savepoint
from the sink, not a parked sibling after another pipeline already published
its part.
* `MultiPipelineSavepointRestoreIT` (#13720) and `DuplicateSavepointIT`
(#13739) only use savepoints that complete on every pipeline.
* `SavepointAfterFinishedSiblingIT` (#13509) starts from a pipeline that
finished naturally, not from a savepoint barrier held on a sibling.
* No engine E2E force-stops a job after one pipeline stored its savepoint
part and before another pipeline acknowledged the same savepoint operation,
then inspects storage, restore admission and slot reuse.
### Does this PR introduce _any_ user-facing change?
No. Test-only: no production code is changed. `FakeSource` and a test-only
stateful sink are used as simple fixtures; no transform, SQL, connector or
format behaviour is exercised.
### How was this patch tested?
```bash
JAVA_HOME=/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home \
./mvnw -o -pl
seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base \
-DskipUT=true -DskipIT=false \
-Dit.test=ForceStopDuringPartialSavepointIT -DfailIfNoTests=false verify
```
* Six green targeted runs on dev `0bef81d003`, `Tests run: 1, Failures: 0,
Errors: 0`, ~8.3–8.6 s each.
* Negative control: moving the `DOING_SAVEPOINT` classification ahead of the
canceled-pipeline classification in `PhysicalPlan`'s pipeline-end callback
makes the test fail (`expected: <CANCELED> but was: <UNKNOWABLE>` after the
false `SAVEPOINT_DONE`). Mutation reverted, the pristine
`seatunnel-engine-server` jar reinstalled (sha256
`ea13c9dec606d695c124c90ed2b786e0855b4d91a502ca51285162fafed7d2e8`) and the
test green again — the guard is not vacuous.
* `spotless:check` on the E2E module passes.
* `./mvnw -o -q -pl seatunnel-ci-tools -Dtest=ImportClassCheckTest
-DfailIfNoTests=false test` passes.
No same-purpose PR was found when searching the open PRs before submitting.
--
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]