zhangshenghang opened a new pull request, #13517:
URL: https://github.com/apache/seatunnel/pull/13517
### Contribution acknowledgement
Thanks for contributing to **Apache SeaTunnel**. This change follows the
repository's contribution guide: it is test-only, adds no new dependencies,
keeps the existing public configuration/API contracts untouched, and includes
the Apache license header on the new files.
### Purpose of this PR
Add a Zeta engine E2E regression guard for a job cancellation that is
**already in flight when the active master dies**.
No existing engine E2E changes master ownership while the job is in
`CANCELING`:
-
`SplitClusterFaultToleranceIT#testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck`
kills the **worker** (not the master) after a task vertex enters `CANCELING`.
- `SplitClusterPendingJobLifecycleFailoverIT` and
`CoordinatorExecutorMassFailoverStormIT` cancel jobs only **after** the
failover has completed.
- `SplitClusterFaultToleranceIT#testStreamJobRestoreInMasterDown` fails over
a job that is simply `RUNNING` with no cancel in flight.
### Contract under test
1. A client cancel is accepted by the active master: the job persists
`CANCELING` and starts cancelling its tasks.
2. The active master is crashed
(`HazelcastInstance#getLifecycleService().terminate()`) exactly inside that
window, and the standby master takes over.
3. The cancellation must not be lost: the job must converge to `CANCELED`,
stay `CANCELED` for a stability window, and the client-visible status must
agree. It must never be left in `CANCELING`/`UNKNOWABLE`.
The test intentionally pins only the terminal outcome; the intermediate
states the restore path passes through before convergence are not asserted here.
### Implementation
- New `CancelDuringMasterFailoverIT` on a split 2-master / 1-worker in-JVM
cluster.
- A streaming `FakeSource` writes into the existing test-only
`FinalCheckpointCloseHoldTest` sink, whose `SinkWriter#close()` parks on
`FinalCheckpointCloseHoldGate`. Cancelling the job therefore freezes the old
attempt on the worker while master ownership moves, instead of letting it
finish during the handoff.
- The test tight-polls the active master's in-JVM job status (a plain
in-memory read) and calls `terminate()` the instant `CANCELING` is observed. If
the cancel wins the race and completes first, the attempt is discarded and
retried (bounded), so the assertions only run on a kill that provably landed
mid-cancel.
- **No production code changes.**
### Verification
On dev `ee0fb0d72f`, JDK 17:
```bash
./mvnw -o -q -pl
seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base \
-DskipUT=true -DskipIT=false -Dit.test=CancelDuringMasterFailoverIT \
-DfailIfNoTests=false verify
# passed 4 consecutive runs, ~22s each
```
Also verified:
```bash
./mvnw -o -q -pl
seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base spotless:apply
# exit 0
./mvnw -o -q -pl seatunnel-ci-tools -Dtest=ImportClassCheckTest test
# exit 0
git diff --check
# exit 0
```
--
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]