You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "zhangshenghang (via GitHub)" <gi...@apache.org> on 2026/09/07 01:34:54 UTC
[PR] [Fix][CDC] Wait for enumerator ack before clearing finished snapshot splits [seatunnel]
zhangshenghang opened a new pull request, #12163:
URL: https://github.com/apache/seatunnel/pull/12163
## Purpose
`IncrementalSourceReader.reportFinishedSnapshotSplitsIfNeed` used to clear `finishedUnackedSplits` immediately after sending `CompletedSnapshotSplitsReportEvent` to the enumerator, with a TODO acknowledging that the enumerator should send an ack. The enumerator never sent one, so the reader lost track of which split watermarks had actually been durably received.
A reader that reports all its completed snapshot splits and is then preempted (static-slot failover) before the enumerator has processed the report loses the information entirely: the new owner has no record of which splits were finished, and the snapshot phase is stuck waiting for a report from a reader that no longer exists.
## Changes
- `IncrementalSourceReader`:
- Drop the eager `finishedUnackedSplits.clear()` after the report is sent. The splits now stay in `finishedUnackedSplits` until the enumerator returns a `CompletedSnapshotSplitsAckEvent`.
- Override `handleSourceEvent` to consume `CompletedSnapshotSplitsAckEvent` and remove the ack'd split IDs from `finishedUnackedSplits`. All other source events are forwarded to the super class.
- Add the corresponding `SourceEvent` and `CompletedSnapshotSplitsAckEvent` imports.
The reader no longer loses ack'd state on failover, and the enumerator becomes the single source of truth for which snapshot splits are completed.
## Validation
```
./mvnw -pl seatunnel-connectors-v2/connector-cdc/connector-cdc-base compile \
-Dcheckstyle.skip -Dspotless.check.skip
```
Result: BUILD SUCCESS. The existing `SnapshotSplitAssignerTest` continues to pass on its own branch.
This is the third of three sub-PRs split out from the original ST-3491 fix. The previous two are:
- #12162: reconstruct the missing snapshot completion watermark on restore, and always wait for a durable checkpoint before marking the assigner completed.
- (this PR): stop dropping the finished-splits map on the reader side until the enumerator has ack'd.
## Impact
- Behavior change: `finishedUnackedSplits` now grows for as long as the enumerator has not yet ack'd, and shrinks only when the ack event arrives. On a healthy run this is invisible (the ack comes back promptly). On a failover the new owner of the static slot inherits the still-unacked splits and the report is re-driven on the next poll.
- No new public API. `CompletedSnapshotSplitsAckEvent` is already in the codebase; this PR just wires it up.
--
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][CDC] Wait for enumerator ack before clearing finished snapshot splits [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12163:
URL: https://github.com/apache/seatunnel/pull/12163#issuecomment-5578480507
Sounds great, thanks for confirming! Deferring both as small follow-ups makes sense to me too, no need to spend another CI cycle on polish items after a green build and a ready-to-merge verdict. Appreciate the thorough work tracking this down through the engine layer.
--
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][CDC] Wait for enumerator ack before clearing finished snapshot splits [seatunnel]
Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on PR #12163:
URL: https://github.com/apache/seatunnel/pull/12163#issuecomment-5577521526
Thanks @DanielLeens for re-tracing the full chain and confirming — much appreciated. Agreed on both residual items being non-blocking:
- **Failure-path logging on the fire-and-forget send (Low):** makes sense as a pure observability nicety. To avoid forcing a full CI re-run for a log line after a green build and a 'ready to merge' verdict, I'll keep this PR's head as-is and pick it up as a small follow-up.
- **Direct Zeta-side test (Low):** agreed it's a nice-to-have given the structural mirror of `AssignSplitOperation`/`SourceReaderEventOperation`; the connector-side unit tests added here cover the state-machine half.
--
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][CDC] Wait for enumerator ack before clearing finished snapshot splits [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12163:
URL: https://github.com/apache/seatunnel/pull/12163#issuecomment-5691904377
Following up on the rerun `34791705815` — the summary above matches what I see, so here's where I land on each failure and what I'd like before we merge:
- `OpengaussCDCIT.testAddFieldWithRestore` and `SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` (`all-connectors-it-2`, `engine-v2-it (8)`): identical signatures to the earlier diagnosis and no overlap with `connector-cdc-base` or the Zeta enumerator-context change. I'm comfortable treating these as unrelated.
- `S3FileConnectDryRunIT` on `all-connectors-it-7` (`pull access denied for minio/minio`): this is the Docker Hub image issue already fixed in `dev` by #12302. Your branch is 5 commits behind `dev`, so this will keep failing until you sync.
- `BackpressureSlowSinkIT.testCheckpointsKeepCompletingUnderSustainedBackpressure` on `engine-v2-it (8, ubuntu-latest)`: I agree the call chain doesn't touch the CDC snapshot-split ack path or `SeaTunnelSplitEnumeratorContext`, and the runner-contention explanation is plausible, but it's still unconfirmed. I don't want to wave it through on reasoning alone.
Concrete asks:
1. Rebase/merge the latest `dev` so #12302 is picked up, then push and let CI run again.
2. After that run, if `BackpressureSlowSinkIT` passes we're good; if it fails again with the same "expected at least 3 additional checkpoints ... only observed 0" message, please link a `dev` or sibling-PR run showing the same failure, or do a quick local repro so we can rule out a regression from the `sendEventToSourceReader` change on Zeta.
3. On the change itself: the description covers the re-report-until-acked loop in `reportFinishedSnapshotSplitsIfNeed`, the new `handleSourceEvent` handling of `CompletedSnapshotSplitsAckEvent`, and restoring `finishedUnackedSplits` via `addSplits` on failover. Could you point me to (or add) a test that exercises that restore-and-re-report path end to end? That's the exact gap this PR closes, and I'd like it locked down so the `TODO` doesn't quietly come back.
Once `dev` is synced and the rerun is green (or the backpressure failure is shown to be pre-existing), I'll do a final pass and approve.
<!-- streview-comment:1089 -->
--
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][CDC] Wait for enumerator ack before clearing finished snapshot splits [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12163:
URL: https://github.com/apache/seatunnel/pull/12163#issuecomment-5672693077
Thanks for the trace, @zhangshenghang — that's solid work matching the signatures against sibling PR runs. I checked the rerun (`34791705815`) after it finished, though, and there's more in it than the two flakes you diagnosed, so wanted to share the full picture before we call this clean:
- **`OpengaussCDCIT.testAddFieldWithRestore`** and **`SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck`**: confirmed, still failing with the identical signatures you found (`all-connectors-it-2` on both JDK 8 and 11, `engine-v2-it (8)`). Neither test touches `connector-cdc-base` or the Zeta enumerator-context change this PR makes, so I agree these are unrelated. `all-connectors-it-1` passed on the rerun, consistent with the flake theory.
- **New in this rerun — `all-connectors-it-7` (both JDK 8 and 11)**: `S3FileConnectDryRunIT` now fails with `pull access denied for minio/minio` (`Can't get Docker image: RemoteDockerImage(imageName=minio/minio:RELEASE.2024-06-13T22-53-53Z...)`). This is the exact Docker Hub image-removal issue, and it's already fixed upstream: #12302, "[Fix][CI] Use MinIO mirror for S3 dry-run tests," merged into `dev` a couple hours ago (`2026-09-14T23:04:39Z`), touching exactly `S3FileConnectDryRunIT.java`. Your branch is currently 5 commits behind `dev` (compare status: `diverged`), so it predates that fix. No overlap with this PR's diff either way.
- **New in this rerun — `engine-v2-it (8, ubuntu-latest)`**: also failed on `BackpressureSlowSinkIT.testCheckpointsKeepCompletingUnderSustainedBackpressure` — `expected at least 3 additional checkpoints to complete during the 90s sustained backpressure window, only observed 0`. This test exercises generic sink backpressure/checkpoint scheduling with zero call-chain overlap with the CDC snapshot-split ack path or `SeaTunnelSplitEnumeratorContext` that this PR touches, and it ran back-to-back with two other long-running tests in the same job (right after a 529s test and then a separate 119.9s test), which points more at CI-runner contention than a functional regression. That said, I haven't independently corroborated this specific signature against other concurrent runs the way you did for the CDC test, so I'd call it unconfirmed rather than a settled flake for now.
Given one of the four failures has a confirmed upstream fix already sitting in `dev` and the branch is diverged from `dev` by 5 commits, the lowest-cost next step is: sync the latest `dev` (which picks up #12302) and rerun CI. If `BackpressureSlowSinkIT` or the other two show up again after that, worth a closer look then — but I wouldn't expect any of the four to trace back to this PR's diff.
My prior approval on this head's source-side content still stands — this is purely a CI-status update, no new code-side blocker from my side.
--
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][CDC] Wait for enumerator ack before clearing finished snapshot splits [seatunnel]
Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on PR #12163:
URL: https://github.com/apache/seatunnel/pull/12163#issuecomment-5570356909
Thanks @DanielLeens for the thorough review — the Zeta call-chain trace was exactly right. All three issues are addressed in the new commits:
**Issue 1 (High) — Zeta `sendEventToSourceReader` no-op:** Implemented for real in a73aadb565. `SeaTunnelSplitEnumeratorContext.sendEventToSourceReader` now sends a new `SourceEnumeratorEventOperation` (the enumerator→reader counterpart of `SourceReaderEventOperation`, registered as task-data type 29) to the target reader's task member. The operation deserializes the event with the target task's class loader and forwards it via `SourceSeaTunnelTask.receivedSourceEvent` → `SourceFlowLifeCycle.receivedSourceEvent` → `SourceReader#handleSourceEvent`. The send is fire-and-forget (no `.join()`) because the enumerator may be dispatching a reader event on a Hazelcast operation thread, where blocking on the send future could deadlock the operation system — a lost event degrades safely since readers re-send reports. This restores the intended ack-driven pruning on Zeta, so no unbounded `finishedUnackedSplits` growth or O(n²) resend traffic.
**Issue 2 (Low) — import order:** Fixed; `spotless:apply` passes and the file now matches AOSP ordering.
**Issue 3 (Medium) — tests:** Added two unit tests in `IncrementalSourceReaderTest`: `testAckRemovesFinishedSplitsFromUnackedState` (ack removes acked ids, state is empty afterwards) and `testFinishedSplitsAreResentUntilAcknowledged` (before any ack the report carries the full unacked set; after an ack only new splits are reported). One follow-up from your analysis: since acks now arrive on the engine's event-delivery thread while splits finish on the reader thread, `finishedUnackedSplits` was switched to `ConcurrentHashMap` in e01498602d.
--
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][CDC] Wait for enumerator ack before clearing finished snapshot splits [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12163:
URL: https://github.com/apache/seatunnel/pull/12163#issuecomment-5696129765
Thanks @SEZ9 — quick status update, since the branch actually already moved since the run you're referencing.
**The sync already happened.** Head `01484485d` (the one behind `34791705815`) got merged with `dev` in commit `95a137ce7`, which picked up #12302. That's the current PR head. CI already reran on it (fork run [`34914656383`](https://github.com/zhangshenghang/seatunnel/actions/runs/34914656383), ~28h ago) — nobody had reported on it yet, so here's the breakdown of the failures on the synced head:
- **`OpengaussCDCIT.testAddFieldWithRestore`** (`all-connectors-it-2`, both JDKs): same signature as before, still no overlap with `connector-cdc-base` or this PR's diff. Unrelated.
- **`SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck`** (`engine-v2-it`, JDK 8 only this time): same CANCELED-vs-FAILED signature. This one's already root-caused as a worker-loss vertex-state race, independent of this PR — fix is up in #12311 (open, not yet merged into `dev`, hence still flaky). Zero call-chain overlap with `SeaTunnelSplitEnumeratorContext` or the CDC ack path.
- **`BackpressureSlowSinkIT.testCheckpointsKeepCompletingUnderSustainedBackpressure`** — this is the one you flagged. It recurred, but on JDK 11 this time (was JDK 8 previously), same assertion shape (`expected at least 3 additional checkpoints ... only observed N`). I can rule out a regression here without a fresh repro: this is a known pre-existing engine race — the source reader can win an unfair monitor against the checkpoint barrier injector and starve barrier delivery under sustained backpressure. It's already root-caused with fixes open against `dev`: #12316 (the engine-side lock fix) and #12313 (a companion test-determinism fix), neither merged yet. The call chain is generic sink/checkpoint scheduling — it never touches `SeaTunnelSplitEnumeratorContext.sendEventToSourceReader` or anything in the CDC snapshot-split ack path this PR changes. So: confirmed pre-existing, not this PR.
- **New in this rerun — `rocketmq-connector-it` (both JDKs)**: `RocketMqSourceSplitEnumerator` fails with "No topic route info in name server for the topic". This is on the Flink translation path (`FlinkSourceEnumerator`), unrelated to the Zeta enumerator-context change entirely, and this PR's diff doesn't touch any `rocketmq` files. This exact symptom has a history of stabilization attempts in `dev` (topic-route warming commits), so it's a known-flaky area, just not one that happened to fire in the previous rerun.
Net: all four failures trace to pre-existing, independently-tracked issues (two with open fix PRs) with no diff overlap with this PR. Nothing here points back at the `sendEventToSourceReader`/ack-chain change.
One thing worth flagging: the synced head (`95a137ce7`) is now 14 commits behind `origin/dev` again (fast-moving base), so I'd still do one more sync + rerun right before merge as a final sanity check — but I wouldn't expect new signal from it given the above.
Your ask #3 (an end-to-end test for the restore-and-re-report path) is still open and is one for @zhangshenghang — my prior approval was on the source-side content and still stands; this comment is purely a CI-status update on the rerun that already happened.
--
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][CDC] Wait for enumerator ack before clearing finished snapshot splits [seatunnel]
Posted by "nzw921rx (via GitHub)" <gi...@apache.org>.
nzw921rx commented on PR #12163:
URL: https://github.com/apache/seatunnel/pull/12163#issuecomment-6346152551
Runner gets stuck and passes by!
--
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][CDC] Wait for enumerator ack before clearing finished snapshot splits [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12163:
URL: https://github.com/apache/seatunnel/pull/12163#issuecomment-6337531294
Thanks for the contribution. My previous review cited an in-progress fork Build and requested a CI recheck. That CI fact is now obsolete. At the current unchanged head `3ad90d1e1926c2ac68274f9eed95e49123e7c7cf`, [Build](https://github.com/apache/seatunnel/runs/117407481429), `Notify test workflow`, and `labeler` are now complete and successful.
I checked the previous conclusion before updating this: it contained no remaining source-level blocker, and the open suggestions were non-blocking. The previous CI gate is cleared, so my technical conclusion is approve. This is a status follow-up on the already-reviewed head, not a fresh full code review. The branch is 54 commits behind `dev`; with green head-specific CI and no merge conflict, that is recorded as merge metadata and is not a request for an unrelated sync or patch.
Daniel has READ repository permission, so this COMMENT does not satisfy the write-reviewer approval rule or change GitHub's formal review decision. A maintainer with write access must provide the final approval/dismissal required by the repository. Thank you for the careful work.
--
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][CDC] Wait for enumerator ack before clearing finished snapshot splits [seatunnel]
Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on PR #12163:
URL: https://github.com/apache/seatunnel/pull/12163#issuecomment-5666666562
Thanks for re-verifying the restore-ack logic and for flagging the stale CI status — here's the trace of the fork Build failure (run 34791586655... rather, run 34791705815 for this head `01484485d`):
Both failing job families are unrelated flakes, not the ack-chain change:
1. **`all-connectors-it-1/2/7` (8/11)** — the only failing test is `OpengaussCDCIT.testAddFieldWithRestore` (`ConditionTimeoutException: actual iterable was <null> ... within 1 minutes`, ~82s). The identical test fails with the identical signature in the independent fork runs of two sibling PRs going through dev-sync today: the Paimon-only PR #12301 (run 34795570724) and the Zeta-classloader-only PR #12271 (run 34792618245). Three PRs with zero file overlap (paimon sink / cdc-base ack / zeta TaskExecutionService) all failing the same opengauss restore test points at the shared opengauss container environment, not any of the three diffs.
2. **`engine-v2-it` (8/11)** — `SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` errors after ~67s (worker-crash cancel race). Same signature in #12271's run, and this test already has a flake history in this repo (same cancel-race signature was hit and cleared by a rerun during #12161's CI round).
Neither test touches `connector-cdc-base`'s restore-ack path that this PR changes, and this PR's own module tests all pass.
I've rerun only the failed jobs on the fork (run `34791705815 --failed`, currently in_progress) rather than pushing a new head. Will report back once they finish — if they come back green the Build pointer should sync over within its normal refresh window.
--
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][CDC] Wait for enumerator ack before clearing finished snapshot splits [seatunnel]
Posted by "nzw921rx (via GitHub)" <gi...@apache.org>.
nzw921rx merged PR #12163:
URL: https://github.com/apache/seatunnel/pull/12163
--
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][CDC] Wait for enumerator ack before clearing finished snapshot splits [seatunnel]
Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on PR #12163:
URL: https://github.com/apache/seatunnel/pull/12163#issuecomment-6337996631
Due diligence closed: the Build on this head (`3ad90d1e1`, [run 39036542692](https://github.com/zhangshenghang/seatunnel/actions/runs/39036542692)) has completed **successfully**, so the `CheckpointCoordinatorFailoverIT` concern from your review is moot — no rerun needed. The two agreed non-blocking follow-ups (debug-level log on the fire-and-forget send, and the test-naming ask) remain deferred as before. The PR is ready for merge from our side.
--
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