You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "88fantasy (via GitHub)" <gi...@apache.org> on 2026/09/18 09:21:07 UTC
[PR] [Fix][Zeta] Resume checkpoints after master switch when idle readers are already closed [seatunnel]
88fantasy opened a new pull request, #12388:
URL: https://github.com/apache/seatunnel/pull/12388
### Purpose of this pull request
Fixes #12386.
After a master switch, `SubPlan#restorePipelineState` reports a RUNNING pipeline as `alreadyStarted` only if **every** physical vertex is `RUNNING`. For an unbounded source such as MySQL-CDC with `parallelism > 1`, idle readers are closed after the snapshot phase (`CloseIdleReaderOperation`), so their task groups are `FINISHED`. The restore therefore reports `alreadyStarted = false`, `CheckpointCoordinator#restoreCoordinator(false)` waits for `READY_START` from tasks that are already running (and will never report it again), and no checkpoint is ever triggered after the takeover. The job stays RUNNING, keeps reading and writing, but 2PC sinks never commit.
Only flipping `alreadyStarted` is not enough: `closedIdleTask` is in-memory state of the old coordinator and is used to exclude closed subtasks from the ACK set (`getNotYetAcknowledgedTasks`), from barrier dispatch (`barrier.closedTasks()` in the enumerator) and from the committer's expected barrier count. Without it the new coordinator would wait for ACKs from closed readers.
This PR:
1. `SubPlan#restorePipelineState`: in a RUNNING pipeline, a `FINISHED` physical vertex no longer marks the pipeline as not started (bounded readers only finish after the final checkpoint, so here it can only be an idle-closed reader). These task groups are collected; coordinator vertices must still be `RUNNING`.
2. The task groups are passed through `CheckpointManager#reportedPipelineRunning(int, boolean, Set<TaskGroupLocation>)` to `CheckpointCoordinator#restoreCoordinator(boolean, Set<TaskGroupLocation>)`, which rebuilds `closedIdleTask` from the plan after `cleanPendingCheckpoint` and before the `alreadyStarted` branch.
3. The existing two-argument methods are kept and delegate with an empty set, so other callers (e.g. pipeline restart) are unchanged.
No new persisted state is added; it relies only on the vertex states already restored from the IMap.
### Does this PR introduce _any_ user-facing change?
Yes. With multiple masters, a CDC job with `parallelism > 1` keeps checkpointing after a master takeover instead of silently stalling.
### How was this patch tested?
- Unit tests:
- new `SubPlanRestoreStateTest#testRestoreRunningPipelineWithIdleClosedTaskGroupIsAlreadyStarted` (enumerator RUNNING, one reader group RUNNING, one FINISHED -> `reportedPipelineRunning(1, true, {group 3})`; before the fix it was `(1, false)`);
- `CheckpointCoordinatorTest#testRestoreCoordinatorRebuildsClosedIdleTasksAfterMasterSwitch` (`closedIdleTask` equals the reader and writer of the closed group and a checkpoint is triggered).
- `CheckpointCoordinatorTest`, `CheckpointManagerTest`, `SubPlanRestoreStateTest`, `StateTransitionCleanupTest`: 27/27 pass; reverting either part of the fix makes the new tests fail.
- Manual test on a separated cluster (2 masters + 3 workers, JDK 8, checkpoint + IMap on S3), MySQL-CDC -> Doris (2PC, delete enabled), `parallelism = 2`, with the fix of #12387 also applied, after one source subtask became FINISHED:
- `kill -9` the active master, run `DELETE`/`INSERT`/`UPDATE` on the source during the takeover: the new master logs `alreadyStarted: true, closed idle task groups: [TaskGroupLocation{..., taskGroupId=3}]`, checkpoints continue immediately, `SinkCommittedCount == SinkWriteCount`, no re-snapshot, sink row count and `SUM` equal to the source. Before the fix no checkpoint was triggered after the takeover and `SinkCommittedCount` stayed constant.
- stop both masters, change the source while the cluster is down, restart everything: the pipeline is redeployed, `closedIdleTask` is cleared by the pipeline restart (`restoreCoordinator(false, [])`), checkpoints resume and the sink equals the source.
Not covered: a master switch that happens exactly while an idle reader is being closed (in `readyToCloseIdleTask`, not yet acknowledged); behaviour there is unchanged by 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/contribution/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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Zeta] Resume checkpoints after master switch when idle readers are already closed [seatunnel]
Posted by "88fantasy (via GitHub)" <gi...@apache.org>.
88fantasy commented on PR #12388:
URL: https://github.com/apache/seatunnel/pull/12388#issuecomment-6484930992
Thanks @DanielLeens for the reviews and CI follow-up. I have rechecked this Apache SeaTunnel PR against the latest dev.
#12042 was merged on October 28, 2026 as b274eb1f2877f62a534933253c6243248521b7e2. It covers both parts of this fix: recognizing finished unbounded reader groups during running-pipeline restoration, and reconstructing closedIdleTask before the next checkpoint. It also includes stricter eligibility checks, unit coverage, and CheckpointCoordinatorFailoverIT.testCheckpointCompletesAfterMasterFailoverWithIdleClosedReader.
I am closing #12388 as superseded by that merged implementation rather than retaining two competing restore paths. The associated issue #12386 is resolved by #12042.
For clarity, this does not claim that this PR's CI is green: its JDK 17 engine-v2-it failure is a worker-loss/cancellation race (expected CANCELED, actual FAILED). The inspected log shows a reader transitioning from RUNNING to FAILED through CoordinatorService.makeTasksFailed, without a master takeover. That failure should be tracked separately; the related open #12311 is not a verified cure for this exact window.
No fresh real-cluster acceptance of the merged implementation is claimed here. Thank you for the review and for landing the upstream fix.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Zeta] Resume checkpoints after master switch when idle readers are already closed [seatunnel]
Posted by "88fantasy (via GitHub)" <gi...@apache.org>.
88fantasy closed pull request #12388: [Fix][Zeta] Resume checkpoints after master switch when idle readers are already closed
URL: https://github.com/apache/seatunnel/pull/12388
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Zeta] Resume checkpoints after master switch when idle readers are already closed [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12388:
URL: https://github.com/apache/seatunnel/pull/12388#issuecomment-6397569839
Thanks for the contribution. The CI fact in my previous review has changed: the exact-head [fork Build](https://github.com/88fantasy/seatunnel/actions/runs/39909860824) is now **completed with failure**, rather than queued/in progress. This updates the old guidance; I am not posting a second source review on the unchanged head `89e19dd6d85c0e59798828f327997573fc6f017c`.
The [inspected failed job](https://github.com/88fantasy/seatunnel/actions/runs/39909860824/job/120271026875) reports `PreconditionViolationException: None of the supporting TestTemplateInvocationContextProviders ... provided a non-empty stream`. Specifically: HbaseIT (22 errors); the inspected transform-v2 part-2, all-connectors-it-2, all-connectors-it-6, and MySQL CDC job samples have the same empty TestTemplate-provider signature.
There is an upstream fix already in latest dev: [#12895](https://github.com/apache/seatunnel/pull/12895), commit `b65fe82b040c203ce669db83431916108f3e866e`. It adds `ContainerSelectionCondition` to skip a suite/method when every engine selected by `RUN_ENGINES` is explicitly disabled, instead of passing an empty invocation stream to JUnit. A genuinely empty container discovery still remains an error. I checked that this head does not contain that commit, and this PR does not change that shared E2E framework.
The comparison is `diverged`, ahead 4 / behind 14 against dev, with no reported conflict. For this demonstrated upstream test-selection failure, please **sync latest dev and rerun the affected failed jobs first**. Do not copy unrelated framework changes into this PR or add dependencies to chase the old failure. Correctly skipped unsupported-engine cases are not runtime test passes; inspect the refreshed run for any other failures and preserve the relevant engine coverage.
No outstanding source blocker from my previous full review. A successful current-head required Build and write-capable maintainer approval remain separate merge gates. Daniel has READ permission; this follow-up is not an effective approval. Thanks for keeping the patch focused.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Zeta] Resume checkpoints after master switch when idle readers are already closed [seatunnel]
Posted by "88fantasy (via GitHub)" <gi...@apache.org>.
88fantasy commented on PR #12388:
URL: https://github.com/apache/seatunnel/pull/12388#issuecomment-6358841885
Thanks @DanielLeens for the detailed review. I have pushed the follow-up to this Apache SeaTunnel PR at `89e19dd6d85c0e59798828f327997573fc6f017c`.
- Merged community `dev@6b63aca173eb8c056db0b78a87539aec3e4ad1a5` without conflicts in `80de0d5e9`.
- Added Javadoc to `restoreCoordinator(boolean, Set<TaskGroupLocation>)`, documenting both parameters and the reconstruction of closed subtasks after pending-checkpoint cleanup.
- Corrected the `SubPlan#restorePipelineState` comment: FINISHED groups can also occur during final-checkpoint completion, so the previous "can only be an idle reader" statement was too strong. This follow-up changes comments only; the existing classification and runtime behavior are unchanged.
Validation on JDK 11:
- Full-reactor `./mvnw spotless:apply`: passed.
- Full-reactor `./mvnw -q -DskipTests verify`: passed; this command skips tests.
- `CheckpointCoordinatorTest`, `CheckpointManagerTest`, `SubPlanRestoreStateTest`, and `StateTransitionCleanupTest`: 36 tests passed, with zero failures, errors, or skips, using:
```shell
./mvnw -pl seatunnel-engine/seatunnel-engine-server -am \
-Dtest=CheckpointCoordinatorTest,CheckpointManagerTest,SubPlanRestoreStateTest,StateTransitionCleanupTest \
-Dsurefire.failIfNoSpecifiedTests=false verify
```
The initial `test`-lifecycle invocation failed before executing tests because config-base's relocated classes are generated during `package`; using `verify` builds those prerequisites before compiling dependent modules.
The final-checkpoint completion window remains unverified, as does a master switch while idle-reader closure is still awaiting acknowledgement. No fresh real-cluster/E2E run was performed for this documentation-only follow-up, and the earlier manual results in the PR description remain historical.
I also found overlapping PR #12042. This follow-up does not add a second classification mechanism; the overlap should be coordinated before merging.
CI for the pushed head is tracked in [Build run 39909860824](https://github.com/88fantasy/seatunnel/actions/runs/39909860824), which currently reports `queued`. Aggregate CI success has not been established. The local results above are complete independently of that CI status.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Zeta] Resume checkpoints after master switch when idle readers are already closed [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12388:
URL: https://github.com/apache/seatunnel/pull/12388#issuecomment-6473845929
Thanks for the contribution. The CI fact cited in my previous conclusion has changed; this follow-up updates that gate on the unchanged reviewed head, without issuing another full source review.
Gate snapshot (2026-10-28T15:55:54+00:00), head `77ba7a5c1aa33d74b7c5b08fe25740c0fcc3211c`: [Build](https://github.com/apache/seatunnel/runs/121485909816) is `FAILURE`.
The blocking jobs are [Run / engine-v2-it (17, ubuntu-latest)](https://github.com/88fantasy/seatunnel/actions/runs/40195888197/job/121177124921) `failure`.
Observed log evidence: `SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck:449->assertEventuallyCanceled:557 ยป ConditionTimeout` `Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.22.2:verify (default) on project connector-seatunnel-e2e-base: There are test failures.`
Please inspect or rerun only the named failed job where a rerun is appropriate. The logs establish the failing stage, but do not alone establish whether the current PR caused it. No matching upstream cure has been proved by this follow-up; a base sync alone is not a verified resolution, so no unrelated module/dependency patch is requested.
My [previous source conclusion](https://github.com/apache/seatunnel/pull/12388#pullrequestreview-5643715815) remains clear for the reviewed scope. CI is not being passed by inference, and this follow-up is not an effective approval.
Comparison recorded in this scan: base `dev`, `diverged`, ahead 5 / behind 46, no merge conflict. Branch drift is metadata here and is not an additional sync request.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Zeta] Resume checkpoints after master switch when idle readers are already closed [seatunnel]
Posted by "88fantasy (via GitHub)" <gi...@apache.org>.
88fantasy commented on PR #12388:
URL: https://github.com/apache/seatunnel/pull/12388#issuecomment-6051878614
@DanielLeens I have synced this PR with `dev@3ac7003fb` (72c99c226). Merged dev without textual conflicts.
Could you please re-review the updated head?
Validation on this head: Spotless, affected-module verify, and 30 focused checkpoint/idle-reader/state-cleanup tests passed.
The local validation above is separate from the GitHub CI results, which are still pending for the updated head.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Zeta] Resume checkpoints after master switch when idle readers are already closed [seatunnel]
Posted by "88fantasy (via GitHub)" <gi...@apache.org>.
88fantasy commented on PR #12388:
URL: https://github.com/apache/seatunnel/pull/12388#issuecomment-6398002519
Thanks for the updated CI diagnosis. I have synced this Apache SeaTunnel PR with `dev@7604a83ec802a0b148e98e557fb9184c48127988` in `77ba7a5c1aa33d74b7c5b08fe25740c0fcc3211c`, including the upstream E2E container-selection fix #12895 (`b65fe82b0`). The merge had no textual conflicts; the PR diff against dev remains the original 5 files, with no additional classification mechanism.
Current-head local validation on JDK 11:
- Full-reactor `./mvnw spotless:apply`: passed, with no tracked-file changes.
- Full-reactor `./mvnw -q -DskipTests verify`: passed; this command skips tests.
- Focused checkpoint/restore tests: **40 passed, 0 failures, 0 errors, 0 skips** (`CheckpointCoordinatorTest`: 17; `CheckpointManagerTest`: 9; `SubPlanRestoreStateTest`: 1; `StateTransitionCleanupTest`: 13), using:
```shell
./mvnw -B -pl seatunnel-engine/seatunnel-engine-server -am \
-Dtest=CheckpointCoordinatorTest,CheckpointManagerTest,SubPlanRestoreStateTest,StateTransitionCleanupTest \
-Dsurefire.failIfNoSpecifiedTests=false verify
```
The [new-head Build](https://github.com/88fantasy/seatunnel/actions/runs/40195888197) is in progress. This is a new run after the dev sync, not a rerun of the old SHA. Aggregate CI success is still pending; unsupported-engine skips must remain distinct from executed runtime coverage.
I have also corrected the PR description's overly strong FINISHED-only-means-idle-reader statement and separated current-head local validation from the historical cluster results. The final-checkpoint completion window and a switch while idle-reader closure awaits ACK remain unverified. No fresh real-cluster/E2E acceptance was run locally.
For the overlap with #12042, could a maintainer confirm the preferred classification rule and merge order? If this PR lands first, #12042's stricter classification could be reviewed on top while preserving the closed-subtask reconstruction here. The two competing rewrites of the SubPlan loop should not both land unchanged. A successful current-head required Build and effective maintainer approval are still separate merge gates.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org