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

   Yes, I am contributing to Apache SeaTunnel. This change only adds regression 
coverage to the Zeta engine E2E suite; no production code is modified.
   
   ### Purpose of this pull request
   
   Adds 
`MultiPipelineSavepointRestoreIT#testSavepointIsPersistedPerPipelineAndRestoredForBothPipelines`,
 an end-to-end test for a two-pipeline `STREAMING` job that goes through 
stop-with-savepoint and then restores both pipelines.
   
   Contract under test:
   
   1. Both pipelines complete ordinary periodic checkpoints, proving the 
checkpoint scheduler is live for the whole job.
   2. A real client stop-with-savepoint request completes and the job reaches 
`SAVEPOINT_DONE`.
   3. `JobClient#getCheckpointData(jobId, RestoreMode.SAVEPOINT)` returns 
exactly one `SAVEPOINT` record per pipeline, and each record's checkpoint id is 
greater than that pipeline's last periodic checkpoint id.
   4. Restoring the same job id brings both pipelines back to `RUNNING`, and 
every pipeline completes a new periodic checkpoint whose id is greater than its 
own savepoint id.
   5. The savepoint records are still selectable after restore and keep their 
ids (a new periodic checkpoint must not overwrite or delete them).
   6. Cancelling the restored job still reaches `CANCELED`.
   
   ### Why this boundary has real regression risk
   
   A savepoint is not a single job-level checkpoint. 
`CheckpointManager#triggerSavePointsAndWaitComplete` fans the request out to 
one `CheckpointCoordinator` per pipeline, and every pipeline must persist its 
own savepoint before the job may reach `SAVEPOINT_DONE`. The restore side is 
equally per-pipeline: `MultipleTableJobConfigParser` requires one checkpoint 
record per source config and rejects the restore unless the record for source 
index `i` carries pipeline id `i + 1`.
   
   A regression that stops the fan-out after the first pipeline, reuses a 
checkpoint id for one pipeline, or persists the records in the wrong pipeline 
order produces a savepoint that still looks successful (`SAVEPOINT_DONE`) but 
cannot be restored at all. Since checkpoint state is retained for 
savepoint-ended jobs, that broken savepoint becomes the only recovery point the 
operator has.
   
   ### Why existing coverage does not reach it
   
   - `SavepointRestoreIT` and `CheckpointRestoreWithStopIT` drive 
single-pipeline jobs.
   - `SavepointBusySourceBarrierIT` documents the per-coordinator fan-out but 
owns exactly one pipeline.
   - `SavepointPreconditionRecoveryIT` races a savepoint against one pipeline's 
task deployment.
   - `CommittedMetricsIT` uses a two-pipeline job but only reads metrics and 
never takes a savepoint.
   
   No existing test asserts that every pipeline of a multi-pipeline job ends up 
with its own, correctly numbered savepoint, or that a restore resumes both 
pipelines from those records.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. This is test-only coverage; no engine behavior, configuration, or API is 
changed.
   
   ### How was this patch tested?
   
   ```bash
   JAVA_HOME=/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home \
   ./mvnw -pl seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base \
     -DskipUT=true -DskipIT=false \
     -Dit.test=MultiPipelineSavepointRestoreIT verify
   ```
   
   - New test on this branch: `Tests run: 1, Failures: 0, Errors: 0`, ~18s.
   - Re-ran the same test a second time on the same branch: passes again.
   - `spotless:apply` produces no changes.
   - No production code changed, so no unit test is affected.
   
   ### 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. https://github.com/apache/seatunnel/tree/dev/docs
   * [ ] If necessary, please update `incompatible-changes.md` to describe the 
incompatibility caused by this PR.
   * [ ] If you are contributing the connector code, please check that the 
following files are updated:
     1. Update 
[plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties)
 and add new connector information in it
     2. Update the pom file of 
[seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
     3. Add ci label in 
[label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
     4. Add e2e testcase in 
[seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
     5. Update connector 
[plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)
   


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