zhangshenghang opened a new pull request, #13444:
URL: https://github.com/apache/seatunnel/pull/13444
Yes, I am contributing to Apache SeaTunnel. This change only adds end-to-end
coverage to the Zeta engine E2E suite; no production code is modified.
### What this PR does
Adds
`SplitClusterPendingJobLifecycleFailoverIT#testSavepointOnPendingJobIsRejectedWithoutTouchingLifecycle`,
an end-to-end test for a savepoint request aimed at a job that has been
submitted but is still `PENDING` because the only worker's fixed slots are
occupied.
Contract under test:
1. The request is rejected at the coordinator's scheduled-job boundary
within a bounded time, with the expected "not running" savepoint failure,
instead of waiting for deployment.
2. Rejection does not touch the lifecycle: the physical plan stays
`PENDING`, no `DOING_SAVEPOINT` state timestamp is recorded, the job remains in
the master's pending queue, and it owns no slot in
`engine_ownedSlotProfilesIMap`.
3. A repeated request (clients and UIs retry) behaves identically and leaves
no deferred savepoint behind over a stability window.
4. Releasing the holder's capacity afterwards proves the rejection is not a
latent state change: the same job still reaches `RUNNING`, acquires its four
fixed slots, and releases them when cancelled.
### Why this boundary has real regression risk
A pending job already owns a live `JobMaster` and `PhysicalPlan`, but the
master only publishes it through `pendingJobQueue`; it enters
`runningJobMasterMap` only after the scheduler pre-applies every slot.
`CoordinatorService#savePoint(long)` deliberately gates on that scheduled flag,
while `cancelJob`/`stopJob` use `getJobMaster()`, which resolves the queue as
well. If a savepoint request were ever routed through the queue the way
cancellation is, `PhysicalPlan#savepointJob()` would move the unscheduled job
from `PENDING` to `DOING_SAVEPOINT` even though no pipeline has a deployed
task. Every checkpoint coordinator would then reject the savepoint with
`TASK_NOT_ALL_READY_WHEN_SAVEPOINT`, and the current failure path would restore
the job to `RUNNING` (not `PENDING`) while it is still queued, desynchronizing
the job state machine from the pending queue. Before #11489 the same sequence
left the job stuck in `DOING_SAVEPOINT` forever. This test pins the rejection
at the coordinator
boundary so a future refactor cannot silently reintroduce either failure mode.
### Why existing coverage does not reach it
- `SavepointPreconditionRecoveryIT` fires a real client savepoint while a
running job's tasks are still deploying and asserts recovery to `RUNNING`; that
job is already in `runningJobMasterMap`.
- The pending-job tests in this class cover dispatch, cancellation and
master failover, but never a savepoint request.
- No test proves that an unscheduled job is rejected before its physical
plan leaves `PENDING`.
### Verification
```
mvn -pl seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base
verify \
-DskipUT=true -DskipIT=false \
-Dit.test='SplitClusterPendingJobLifecycleFailoverIT#testSavepointOnPendingJobIsRejectedWithoutTouchingLifecycle'
\
-Dlicense.skipAddThirdParty=true -Dspotless.check.skip=true
```
- New test passes on `dev` (`85c150df16`) in ~14s.
- The full `SplitClusterPendingJobLifecycleFailoverIT` class is also run
locally to confirm no interference with the existing scenarios.
- `spotless:check` passes.
- Regression-sensitivity check: resolving the queued `JobMaster` through
`getJobMaster()` in the savepoint gate made the test fail immediately; the
temporary probe was reverted and is not part of this PR.
- Searched open/closed issues and PRs for an equivalent test; none found.
### Does this PR need Docs?
- [x] No. This PR only adds engine E2E coverage.
### Does this PR need any UT/E2E?
- [x] Yes. This PR is the E2E coverage.
--
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]