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

   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.
   
   ### Purpose of this pull request
   
   Adds `SavepointDuringInFlightCheckpointIT`, an end-to-end test for a client 
savepoint request that arrives while a periodic checkpoint is still pending on 
the pipeline.
   
   Contract under test:
   
   1. The savepoint request waits for the in-flight checkpoint and then 
completes; the job reaches `SAVEPOINT_DONE` instead of failing or hanging.
   2. The checkpoint that was pending when the savepoint was requested is 
recorded as completed, not abandoned or canceled, and no checkpoint around the 
savepoint is recorded as failed.
   3. No pipeline is restored, and no checkpoint remains in progress after the 
job stops.
   4. The savepoint allocates a checkpoint id newer than the checkpoint it 
waited for.
   
   The fixture (`stream_fake_to_inmemory_slow_checkpoint.conf`) uses the 
existing `checkpoint_sleep` option of the test InMemory sink, which sleeps five 
seconds in `prepareCommit`, with a one-second checkpoint interval. A checkpoint 
is therefore in flight for most of the job's lifetime. The test waits, through 
the checkpoint overview state store, for a checkpoint triggered less than two 
seconds ago and immediately issues a real client savepoint, so it lands inside 
the window deterministically instead of relying on a sleep.
   
   ### Why this boundary has real regression risk
   
   Whether a savepoint request arrives while a periodic checkpoint is pending 
is pure timing, so a regression here surfaces as an intermittent 
stop-with-savepoint failure that is hard to reproduce by hand. Two plausible 
coordinator changes break it: rejecting the savepoint while a checkpoint is 
pending (a tempting simplification of the existing wait), and canceling the 
pending checkpoint so the savepoint can start immediately. The first turns 
stop-with-savepoint into an intermittent failure; the second makes the 
checkpoint overview that operators and the REST API read report a failed 
checkpoint around every savepoint.
   
   ### Why existing coverage does not reach it
   
   - `SavepointPreconditionRecoveryIT` fires a savepoint while tasks are not 
yet ready, so the request is rejected before any checkpoint exists.
   - `SavepointBusySourceBarrierIT` delays the savepoint's own final barrier; 
it never races a periodic checkpoint.
   - `SavepointRestoreIT`, `SavepointClusterRestartRestoreIT` and 
`MultiPipelineSavepointRestoreIT` issue savepoints when no checkpoint is in 
flight.
   - No E2E triggers a savepoint deliberately inside the window of a pending 
periodic checkpoint and then inspects the in-flight checkpoint's final status.
   
   ### Does this PR introduce any user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   ```
   ./mvnw -pl seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base 
verify \
     -DskipIT=false -DskipUT=true -DfailIfNoTests=false \
     -Dit.test=SavepointDuringInFlightCheckpointIT
   ```
   
   Result: `Tests run: 1, Failures: 0, Errors: 0` in about 25 seconds, on three 
consecutive runs on `dev` (`ee0fb0d72f`). `./mvnw spotless:apply` was run 
before each run.
   
   Negative control: returning `CheckpointCloseReason.CHECKPOINT_INSIDE_ERROR` 
from `CheckpointCoordinator#startSavepoint` when `pendingCounter > 0` (the 
"reject while a checkpoint is pending" regression above) makes the test fail at 
the savepoint request. The engine change was reverted and is not part of this 
PR.
   
   ### Check list
   
   * [ ] If any new Jar binary package adding in your PR, please add License 
Notice according
     [New License 
Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/developer/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new 
feature.
   * [ ] If necessary, please update `incompatible-changes.md` to describe the 
incompatibility caused by this PR.
   * [x] The change is test-only and does not touch connector code.
   


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