You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "li3zhi4 (via GitHub)" <gi...@apache.org> on 2026/08/19 16:03:26 UTC
[PR] [Fix][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
li3zhi4 opened a new pull request, #11885:
URL: https://github.com/apache/seatunnel/pull/11885
### Purpose of this pull request
Fixes [issue #11884](https://github.com/apache/seatunnel/issues/11884): MySQL CDC `stop.mode = "latest"` silently drops every change written while the snapshot phase is running.
**Root cause**: `IncrementalSplitAssigner` creates the incremental split once and calls `offsetFactory.latest()` at that moment, freezing the binlog position (job-start time) into `IncrementalSplit.stopOffset` (a `final` field). For snapshot-taking startups (`initial`/`earliest`) the snapshot phase advances the binlog well past that stale offset, so when the binlog phase starts `checkStopOffset()` immediately sees `currentBinlogOffset.isAtOrAfter(stopOffset) == true` and the job finishes without reading any post-snapshot change.
**Fix**: resolve the effective stop offset **when the binlog phase starts** instead of at split-creation time. `MySqlBinlogFetchTask.execute()` now calls `MySqlConnectionUtils.currentBinlogOffset(connection)` for `stop.mode = latest` and passes it to `BoundedMySqlStreamingChangeEventSource`; `checkStopOffset()` prefers the dynamic offset for `latest`. `specific`/`timestamp` stop modes keep the split's configured offset — behavior unchanged.
### Does this PR introduce _any_ user-facing change?
Yes: `stop.mode = "latest"` now terminates at the binlog position captured when the binlog phase begins (after the snapshot), so changes produced while the snapshot ran are no longer lost. For non-snapshot startups (`latest`/`specific`/`timestamp`) behavior is unchanged.
### How was this patch tested?
- E2E: five startup modes (`initial`/`earliest`/`latest`/`specific`/`timestamp`) × `stop.mode = latest` (`testMysqlCdc{Initial,Earliest,Latest,Specific,Timestamp}StartupWithLatestStop`).
- For `initial`/`earliest`, the test issues an `UPDATE` while the job is RUNNING and asserts the post-snapshot change (`f_varchar='latest-stop'`) is synced to the sink — this assertion **fails on the old stale stop offset** and passes with the fix.
- Existing `specific`-stop tests still pass (no regression).
- `spotless:check` ✅, unit tests ✅ (local).
### Check list
- [x] Code changes complete and verified locally (5 startup modes × latest-stop e2e)
- [x] Related unit tests pass
- [x] New e2e tests added with data-boundary assertions
- [x] `mvn spotless:check` passes
- [ ] Docs updated if needed (behavior now matches the documented `stop.mode=latest` semantics)
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5611764700
@DanielLeens thanks for re-fetching the review body and restating the F1–F8 mapping against `befad345c` — that clears up the rendering confusion, and the explanations make sense to me.
One thing before I mark items closed: your comment describes what the diff contains, but I still need to verify each point against the actual changes at `befad345c` rather than the restatement alone. Could you point me at the concrete locations so I can check them quickly?
- **F1/F6** — the test method in `IncrementalPhaseStateTest` that deserializes bytes produced *without* `stopOffset` (the pre-upgrade checkpoint case), and the round-trip test that goes through real serialization.
- **F2** — the `createIncrementalSplit()` hunk with the `resolvedStopOffset == null` guard, and where `HybridSplitAssigner` guarantees incremental splits are only created after snapshot completion.
- **F5** — the `resolveLatestStopOffsetWithRetry()` hunk (attempt count / backoff).
- **F3** — the `runLatestStopStartupMode` assertion that id=2000 is not yet present after id=1 arrives.
- **F4/F7/F8** — the doc hunks for the `latest` snapshot-completion semantics, and please make sure the docs checkbox in the PR description is ticked so the checklist matches the diff.
Once I can see those hunks I'm happy to close everything out — nothing in your explanation looks wrong to me, I just want the closure to rest on the diff rather than the summary.
<!-- streview-comment:931 -->
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5617127450
@li3zhi4 Thanks for independently pulling the same hunks — your line citations for F1/F6, F2, F5, F3, and F4/F7/F8 match what I verified in my own comment above at every location I checked: same files, the same `resolvedStopOffset == null` guard at `IncrementalSplitAssigner.java:329-343`, the same bounds in `resolveLatestStopOffsetWithRetry`, the same assertion in `MysqlCDCStopModeSpecificIT`, and the same doc line numbers. Two independent re-reads of `befad345c` landing on identical locations is a good sign there's no real gap hiding behind the earlier rendering issue.
@SEZ9 between my comment and li3zhi4's, every hunk you asked for is now pointed at directly rather than summarized. Let us know if anything still looks off once you've checked them against the diff yourself — otherwise this looks ready to close out on your 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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-6159409276
Thanks @li3zhi4 for the point-by-point mapping against `7f17332b7a` — that is exactly the information I was missing.
I'm not marking anything resolved from the mapping alone; I'll verify each item against the changed files at `7f17332b7a` before closing it. A few things I'll be looking at specifically, and where a pointer from you would help:
- **F1/F6:** whether the round-trip in `IncrementalPhaseStateTest` exercises the same serialization path the enumerator uses for its checkpoint state, so the `stopOffset` field is proven to survive a real checkpoint/restore.
- **F2:** the `resolvedStopOffset == null` guard addresses the pre-completion split case, but the finding also covered multiple splits assigned around the resolution point ending up with different stop positions. Which test or code path rules that out?
- **F3:** how the e2e test establishes that the snapshot is still active when it asserts row 2000 is not visible (e.g. row count relative to `snapshot.split.size=20`), so the negative assertion cannot pass trivially on a fast run.
- **F5, F4/F7/F8:** the retry/backoff and the EN/ZH `MySQL-CDC.md` updates look like they cover these; I'll confirm against the diff.
Once I've checked those, I'll update the findings accordingly.
<!-- streview-comment:1732 -->
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5633067478
@SEZ9 Checked the stored comment body directly via the API (not the rendered view) — @li3zhi4's comment at `befad345c` is not actually truncated. The full sentence after "`DefaultSerializer` → `Ser..."` reads: "...the same mechanism the engine's `DefaultSerializer` → `SerializationUtils` uses, so it exercises the actual persistence path" (the `IncrementalPhaseStateTest` bullet under F1/F6). The comment also restates later, for context, that `connector-cdc-base` has no `PendingSplitsStateSerializer` class and `IncrementalSource` has no `getEnumeratorStateSerializer` override, so the engine falls back to the interface default `DefaultSerializer` → `SerializationUtils` — which is exactly the serialization path F1/F6 needs exercised, and matches what I verified independently in my own review.
On the rest: the F2/F5 guard at `IncrementalSplitAssigner.java:329-343`, the F3 assertion in `MysqlCDCStopModeSpecificIT`, and the F4/F7/F8 doc locations are as li3zhi4 and I both confirmed above — nothing further from my side. Once you've checked F1/F6 against the diff with the full text above, this should be ready to close out.
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "li3zhi4 (via GitHub)" <gi...@apache.org>.
li3zhi4 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-6159895468
Thanks @SEZ9 \u2014 I checked the requested interactions on current head `7f17332b7a`:\n\n- **F1/F6, same checkpoint serialization path:** `IncrementalSourceEnumerator` exposes `getEnumeratorState()` by returning `splitAssigner.snapshotState(...)` (`IncrementalSourceEnumerator.java`, `getEnumeratorState` around lines 157-161); the engine persists that enumerator state through its configured `EnumeratorStateSerializer`. On connector-cdc-base there is no dedicated `PendingSplitsStateSerializer` and IncrementalSource does not override `getEnumeratorStateSerializer`, so the source-interface default serializer applies; the `IncrementalPhaseStateTest` round-trip at `:35-46` uses real `ObjectOutputStream`/`ObjectInputStream` (`:64-72`), i.e. the same default Java-serialization mechanism, and pins the new field plus legacy null behavior. The assigner restore/write path remains `IncrementalSplitAssigner.java:114-125` and `:225-227`; the in-flight legacy fallback is `:202-219`.\n- **F2, no
split can acquire a later/different latest offset:** all incremental splits are created through the one `resolvedStopOffset == null` guard at `IncrementalSplitAssigner.java:323-351`. The first call resolves once and assigns that value before creating the split; each later split reuses the cached value. `shouldResolveLatestStopOffsetOnceAtSplitCreationAndReuseAfterRestore` at `IncrementalSplitAssignerTest.java:157-197` verifies `latest()` is called once and the restored/later split has the same offset; the legacy fallback test is at `:200-236`.\n- **F3, the snapshot is demonstrably still active:** `MysqlCDCStopModeSpecificIT.java:340-423` uses 2,000 snapshot rows, `parallelism=1`, and `snapshot.split.size=20` (`mysqlcdc_stop_mode_latest.conf:18-40`), waits for id 1 at the sink, and asserts id 2000 is absent before issuing the post-snapshot update at `:425-449`. This cannot pass merely because a small snapshot completed quickly.\n- **F5 and docs:** retry is three attempts with 300/600
ms backoff in `IncrementalSplitAssigner.java:379-414`; EN/ZH option semantics are `MySQL-CDC.md:203` / `:202`, bounded-read explanation `:544-548` / `:536-539`.\n\nThe existing tests establish serialization of the state object and assigner reuse across state restoration; they are not a full engine checkpoint-container integration test. The actual configured checkpoint path nevertheless reaches this state through the default serializer described above. No new code change appears necessary for these points.\n
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "li3zhi4 (via GitHub)" <gi...@apache.org>.
li3zhi4 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5364453320
Thanks for the thorough round-2 review, @DanielLeens — both High blockers confirmed addressed. Two follow-ups on your remaining items:
**Issue 2 (first-split staleness) — confirmation, with the timing guarantee:**
The first incremental split cannot observe a stale stop offset because of a hard ordering guarantee in the enumerator, independent of `resolvedStopOffset`:
1. `HybridSplitAssigner.getNext()` only enters incremental allocation after `snapshotSplitAssigner.isCompleted()` is true (`HybridSplitAssigner.java:99-117`) — i.e. after the snapshot assigner has turned `assignerCompleted` (all snapshot splits executed, parallelism=1 short-circuit at `SnapshotSplitAssigner.java:206-210`).
2. `IncrementalSplitAssigner.getNext()` (first call, `splitAssigned=false`) executes `createIncrementalSplits()` → `createIncrementalSplit()` → `StopConfig.getStopOffset(offsetFactory)` → `offsetFactory.latest()`. Since step 1 guarantees this happens strictly *after* the snapshot phase finished consuming the table, the resolved offset already covers every change written during the snapshot window — it is not stale.
3. `completedSnapshotPhase()` itself is gated by `checkArgument(splitAssigned && noMoreSplits())` (`IncrementalSplitAssigner.java:324`), so it necessarily runs *after* the split was created; the offset it resolves (`resolvedStopOffset`) is therefore at-or-after the split-creation offset, and `createIncrementalSplit()` prefers it whenever non-null.
So the roles are: split-creation resolution is already correct by ordering, and `resolvedStopOffset` adds (a) the checkpoint-stable value reused on restore (no drift — the actual fix for Issue 1 in round 1), and (b) a consistent post-snapshot value for any split created after `completedSnapshotPhase`. Both point to the same post-snapshot position in practice.
**Issue 1 (readiness signal) — attempted the structural fix, found it infeasible for `earliest`, accepting the residual risk:**
I tried replacing the `RUNNING` gate with a real "snapshot has started reading" signal: wait until the first bulk row (id=1, 'bulk') is visible in the sink, with `snapshot.split.size = 20` to keep the 200-row table multi-split. This works for `initial`, but **fails for `earliest`**: `earliest` takes no snapshot phase (the incremental split's `completedSnapshotSplitInfos=[]` and its startup offset is the earliest binlog position), so the sink never sees the bulk rows until the binlog phase replays them from the beginning of the binlog — which does not happen within the 60s readiness window. Log evidence from the run: `IncrementalSplit(tableIds=[...], startupOffset={... mysql-bin.000001, pos=4 ...}, stopOffset={...}, completedSnapshotSplitInfos=[], ...)` for the earliest job, vs 10 `CompletedSnapshotSplitInfo` entries for the initial job.
Since the structural signal cannot be made uniform across all five startup modes without significant test-harness surgery (e.g. waiting on binlog replay progress), I reverted to the wide-margin approach (200-row bulk insert + immediate post-`RUNNING` UPDATE) that CI demonstrated green, and I **explicitly accept the residual (much smaller) flake risk** on the `initial`/`earliest` readiness timing — same trade-off you offered as acceptable.
Current head is unchanged from the round-2 review point (`c58fc10c3`): enumerator-side single resolution + checkpointed stop offset + unit test + CI-green E2E. Happy to take any further feedback.
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5385704175
Thanks for the deep dive, @SEZ9 — this is a very thorough round. I want to push back on **Issue 1** specifically (the "checkpoint serializer not wired up" blocker), since I went and re-verified it against the actual source before replying rather than taking it at face value.
There is no `PendingSplitsStateSerializer` class anywhere in `connector-cdc-base` — I grepped the whole module and found none. Checkpoint (de)serialization for the enumerator state instead goes through the generic path:
- `SourceSplitEnumeratorTask.java:112` obtains `enumeratorStateSerializer` from `this.source.getSource().getEnumeratorStateSerializer()`.
- `connector-cdc-base` never overrides that method, so it falls back to `SeaTunnelSource.java:120-122`'s default: `return new DefaultSerializer<>();`
- `DefaultSerializer.serialize/deserialize` (`seatunnel-api/.../serialization/DefaultSerializer.java`) just does whole-object Java serialization via `SerializationUtils`, on anything that implements `Serializable`.
- `IncrementalPhaseState implements PendingSplitsState`, and `PendingSplitsState extends Serializable`. The new `stopOffset` field is typed `Offset`, and `Offset` itself `implements ... Serializable` (`Offset.java:33`).
So there's no separate field-by-field serializer to "wire up" here — standard Java serialization walks the whole object graph automatically, and `stopOffset` is captured in the checkpoint bytes with zero additional code. On old checkpoints written before this field existed, default Java deserialization sets the missing field to `null` (which is exactly the behavior the class's explicit `serialVersionUID` and its "Preserve compatibility with checkpoints written when this state had no fields" comment are guarding), and `IncrementalSplitAssigner`'s restore path already treats `null` as "not yet resolved" and falls back correctly. This matches what I'd already confirmed in my round-3 review (section 3.4): "checkpoint compatibility for `IncrementalPhaseState`'s new `stopOffset` field is correctly handled."
So I don't think Issue 1 holds as a blocker — happy to be shown otherwise if I've missed a serializer somewhere, but I checked this concretely rather than by inspection alone.
I haven't independently re-verified Issues 2–8 to the same depth yet (this is a lighter-weight follow-up pass, not a full re-review round), but Issue 5 (unguarded `offsetFactory.latest()` DB call with no retry on the enumerator's completion path) and Issue 4 (docs not updated for the `stop.mode=latest` behavior change) both look like reasonable, worth-addressing points on a quick read. Separately, please note this PR still has an open blocker from my own round 3 that's independent of anything here: `HybridSplitAssignerTest.testCompletedSnapshotPhase` NPEs deterministically against `completedSnapshotPhase()`'s new code due to a missing null-guard on `context.getSourceConfig()` — that's currently the thing actually keeping CI red on this head, and it'll need a fix alongside whatever comes out of this round's discussion.
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5601152258
@SEZ9 @li3zhi4 confirmed — I re-fetched my 2026-09-08 review body directly via the API (not the rendered view) and it is complete end to end, including the `2026-09-08T05:07:10Z` paragraph and the full F1-F8 mapping SEZ9 asked about. Nothing is missing server-side; this looks like the same markdown-rendering artifact I ran into on another PR's thread this same week (a long review body apparently trips up some clients' renderer around certain inline-code/heading combinations, not GitHub's stored content). @li3zhi4's repost above is accurate — it matches my original text verbatim on all five points.
@SEZ9, to directly restate what you flagged as still needing a pointer, now confirmed against the actual diff at `befad345c` (not just the summary):
- **F1/F6**: no separate checkpoint serializer exists to "wire" in this codebase — confirmed by the absence of any `PendingSplitsStateSerializer`-style class under `connector-cdc-base`. The stop offset is a plain field on the `Serializable` `IncrementalPhaseState`, picked up automatically by the engine's default `DefaultSerializer` (plain Java object serialization). `IncrementalPhaseStateTest` exercises exactly that round-trip plus the legacy-field-absent (pre-upgrade checkpoint) case. Resolved.
- **F2**: `resolvedStopOffset == null` inside `createIncrementalSplit()` is the single resolution point; `HybridSplitAssigner` only creates incremental splits after snapshot completion, so there's exactly one resolution per assignment, shared by every split it produces. Resolved.
- **F5**: `resolveLatestStopOffsetWithRetry()` in `IncrementalSplitAssigner.java` retries up to 3 attempts with 300ms/600ms backoff before wrapping and throwing. Resolved.
- **F3**: `runLatestStopStartupMode` waits for row id=1 at the sink, then defensively asserts row id=2000 is NOT yet present before proceeding — a runtime-verified structural gate, not just a documented claim. Resolved.
- **F4/F7/F8**: `docs/en|zh/connectors/source/MySQL-CDC.md` documents the snapshot-completion semantics for `latest` with a worked example, and the PR description names the enumerator-side mechanism (`IncrementalSplitAssigner.createIncrementalSplit()`). Resolved.
No new commit since I last reviewed — the head is still `befad345c`. Happy to hear if either of you still sees an open item after checking the reposted/re-fetched text above against the current diff yourselves.
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "li3zhi4 (via GitHub)" <gi...@apache.org>.
li3zhi4 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-6073708879
@SEZ9 @nzw921rx — synced the branch with current dev `3556e91cc9`, cleanly, to adopt the upstream CI fixes rather than continually rerun deterministic registry/link failures. Current head is `99d1db7934`; the stop-offset implementation and the F1-F8 changes you were verifying are retained. The merge includes #12639 for DeepWiki429, #12297 for the unavailable MinIO images causing the Hudi/Paimon ContainerFetch errors, and #12394 for the Windows fixture collision.
There is currently no new fork Build run/check suite for this SHA, despite the recorded push, Actions enabled, and workflows matching upstream. Upstream therefore reports `ACTION_REQUIRED` / workflow-run detection failed. This is not green CI and not a newly observed test regression; the dispatch/account gate must be resolved first.
Please complete the promised final review against the synced head and give/update a normal approving review when satisfied. dev's merge queue requires a current valid approval and a successful Build, so a comment-only sign-off does not by itself remove the merge gate. My account cannot issue formal reviewer requests through the API.
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "li3zhi4 (via GitHub)" <gi...@apache.org>.
li3zhi4 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5882568051
Gentle close-out nudge \u2014 @SEZ9 you mentioned \"Once I can see those hunks I'm happy to close everything out.\" The concrete locations at `befad345c` were posted (mine) and independently verified by @DanielLeens to match his own re-read at every location, including the missing F1/F6 sentence DanielLeens later confirmed via the raw API body. Everything on the checklist is satisfied from my side.\n\nTwo updates since: (1) I've synced the branch with the latest `upstream/dev` \u2014 new head `b0ab23fb03`, conflict-free; notably `#11271` (which touched `IncrementalSplitAssigner` in the same area) was already part of this branch's base, and the merge with current dev is clean. (2) Fresh CI is running on the new head; I'll post the result here. With 3.0.0 now cut, this fix would ride the next release train \u2014 a final confirmation from you (or, if you're tied up, a look from @davidzollo / @nzw921rx) would be much appreciated.\n
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "li3zhi4 (via GitHub)" <gi...@apache.org>.
li3zhi4 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5364573735
Following up on Issue 1 from round 2 (the readiness-signal race): rather than settling for the accepted residual flake risk, I've now replaced the probabilistic timing margin with a **structural readiness gate** (commit `a396320c7`):
**What changed:**
- **`initial`**: before issuing the UPDATE, the test waits until the first bulk row (`id=1`, `'bulk'`) is visible in the **sink**. With `snapshot.split.size = 20` added to the job config, the 200-row table is read in 10 snapshot splits — so this sink-readiness signal can only fire **while the snapshot is still reading the remaining splits**. The UPDATE is therefore *guaranteed* to land inside the snapshot window and be picked up by the binlog phase. No timing margin involved: it is a data-visible proof that the snapshot phase is mid-flight.
- **`earliest`**: I removed the post-snapshot UPDATE assertion entirely. Investigation showed `earliest` has **no snapshot phase** — its incremental split is created with `completedSnapshotSplitInfos=[]` and binlog replay starts from the earliest binlog position (`mysql-bin.000001 pos=4` in the observed run). Whether the UPDATE is captured then depends on enumerator stop-offset resolution timing versus the UPDATE, which is *not* a deterministic contract — asserting it would itself be a race. The test still asserts RUNNING and FINISHED for `earliest`, and the data-capture contract (post-snapshot changes are not dropped) is deterministically covered by the `initial` case.
- `latest`/`specific`/`timestamp`: unchanged (no snapshot window; the UPDATE not being read is expected; RUNNING/FINISHED asserted).
**Verification (local):** `initial`+`earliest` 2/2, `latest`+`specific`+`timestamp` 3/3, existing `specific`-stop regression 2/2 — 7/7 green. `spotless:check` ✅, compile ✅.
This supersedes my earlier "accept the residual flake risk" stance: the race is now structurally closed for the `initial` case that exercises the data-loss scenario, and the `earliest` case no longer asserts a non-deterministic outcome. Happy to take another look if you'd like any adjustment.
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "li3zhi4 (via GitHub)" <gi...@apache.org>.
li3zhi4 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5598876185
@SEZ9 Reposting the portion of @DanielLeens' review above that gets truncated in some views — the findings mapping it contains, verbatim:
- **F1/F6 (serializer wiring / test bypass)**: `connector-cdc-base` has no `PendingSplitsStateSerializer` class at all. `IncrementalSource` does not override `getEnumeratorStateSerializer()`, so the engine uses the interface default `DefaultSerializer`, whose `serialize()`/`deserialize()` call `SerializationUtils` — plain `ObjectOutputStream`/`ObjectInputStream` over the `Serializable` object graph. A plain field on a `Serializable` class with unchanged `serialVersionUID` is picked up automatically; there is no separate serializer to "wire" in this codebase. `IncrementalPhaseStateTest.shouldPreserveStopOffsetThroughJavaSerializationRoundTrip` exercises exactly this real persistence path, and `shouldDefaultStopOffsetToNullOnLegacySerializedState` covers the legacy (field-absent) checkpoint. Resolved.
- **F2 (single authoritative resolution point)**: the current design resolves inside `createIncrementalSplit()`, guarded by `resolvedStopOffset == null` — `HybridSplitAssigner` only creates incremental splits after snapshot completion, so there is exactly one resolution point and every split from one assignment shares the cached value. Resolved.
- **F5 (retry with backoff)**: `resolveLatestStopOffsetWithRetry()` in `IncrementalSplitAssigner.java` retries up to 3 attempts with 300ms/600ms backoff before wrapping and throwing. Resolved.
- **F3 (E2E readiness gate)**: `runLatestStopStartupMode` waits for row id=1 at the sink, then defensively asserts row id=2000 is NOT yet in the sink before proceeding — it verifies the structural guarantee at runtime and fails loudly instead of producing a false data-loss failure. Resolved.
- **F4/F7/F8 (docs / PR description)**: `docs/en|zh/MySQL-CDC.md` document the snapshot-completion semantics with a worked example, and the PR description names the enumerator-side mechanism (`IncrementalSplitAssigner.createIncrementalSplit()`).
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-6137847793
Thanks for keeping the branch current. Since `befad345c1` the head has only moved through two `dev` merges (`b0ab23fb03`, `99d1db7934`), and the latest re-review of `99d1db7934ce` reports the PR's own added/removed lines as unchanged. To close out my earlier points efficiently, could you point me to where each of these is handled in the current diff?
1. **Checkpoint round-trip for `stopOffset` (F1 / F6)** — the exact code that persists and restores the resolved offset in `IncrementalPhaseState`, plus the `addSplits()` fallback for checkpoints taken before this field existed. If `IncrementalSplitAssignerTest` already exercises the restore through the real state serializer rather than constructing the state object directly, a pointer to that test would settle this.
2. **Stop-boundary consistency (F2)** — how a split created before snapshot completion and the checkpointed `resolvedStopOffset` are kept from disagreeing, and how multi-split assignments avoid straddling the resolution.
3. **E2E readiness gate (F3)** — what the `initial`-startup `latest-stop` assertion now gates on to prove the snapshot is still in progress, since id=1 reaching the sink alone does not establish that.
4. **Retry on the offset lookup (F5)** — where `resolveLatestStopOffsetWithRetry()` lives and what its bounds are.
5. **Docs and PR description (F4 / F7 / F8)** — where the `stop.mode = latest` semantics are documented, and a quick confirmation that the PR description reflects the enumerator-side implementation and the `initial`-only scope of the post-snapshot e2e assertion rather than `MySqlBinlogFetchTask` / `BoundedMySqlStreamingChangeEventSource`.
Once I have those pointers I'll do a focused re-check of just these items.
<!-- streview-comment:1720 -->
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "li3zhi4 (via GitHub)" <gi...@apache.org>.
li3zhi4 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-6144040480
Thanks @SEZ9 \u2014 I rechecked the exact current head `7f17332b7a` and mapped all five points below.\n\n- **F1/F6 \u2014 checkpoint persistence and legacy fallback:** `IncrementalPhaseState.java:24-52` contains the unchanged `serialVersionUID`, `stopOffset` field and constructors; `IncrementalSplitAssigner.java:114-125` restores state, `:202-219` adopts the in-flight/legacy split fallback, and `:225-227` writes the checkpoint state. The real Java serialization round-trip and legacy-null tests are `IncrementalPhaseStateTest.java:32-73`; the assigner fallback coverage is `IncrementalSplitAssignerTest.java:200-236`.\n- **F2 \u2014 one authoritative stop boundary:** the single `resolvedStopOffset == null` guard and reuse are in `IncrementalSplitAssigner.java:323-351`; `HybridSplitAssigner.java:99-117` only enters incremental allocation after snapshot completion. Resolve-once/reuse-after-restore coverage is `IncrementalSplitAssignerTest.java:157-197`.\n- **F3 \u2014 readiness gate:**
`MysqlCDCStopModeSpecificIT.java:340-423` waits for row 1, asserts row 2000 is not visible while the snapshot is still active, and only then performs the post-snapshot update/assertion at `:425-449`; `mysqlcdc_stop_mode_latest.conf:18-40` sets `snapshot.split.size=20`.\n- **F5 \u2014 bounded retry:** `IncrementalSplitAssigner.java:379-414` performs three total attempts with 300ms then 600ms backoff and preserves interruption.\n- **F4/F7/F8 \u2014 docs/description:** the EN MySQL CDC semantics are at `docs/en/connectors/source/MySQL-CDC.md:203` and `:544-548`; the matching ZH sections are at `docs/zh/connectors/source/MySQL-CDC.md:202` and `:536-539`. The current PR description matches the enumerator-side, post-snapshot, checkpointed resolution and the `initial` E2E scope.\n\nThe PR body checkboxes are all checked. I found no missing implementation item; the remaining gate is the current Build/approval process, not a source-level issue.\n
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "li3zhi4 (via GitHub)" <gi...@apache.org>.
li3zhi4 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5351017608
Thanks for the detailed and fair review, @DanielLeens. I've reworked the fix to **Option B** (resolve once at the enumerator when the snapshot phase completes), addressing both High issues:
**Issue 1 (restart/checkpoint stability) — fixed via Option B:**
- `IncrementalSplitAssigner.completedSnapshotPhase()` now resolves `stop.mode=latest`'s stop offset **exactly once**, when the snapshot phase is confirmed complete, and stores it in `IncrementalPhaseState` (new `stopOffset` field, checkpoint-compatible).
- `createIncrementalSplit()` prefers the resolved stop offset; `specific`/`timestamp`/`never` keep `StopConfig.getStopOffset()` (unchanged behavior).
- The reader-side re-resolution in `MySqlBinlogFetchTask.execute()` is **reverted** — no per-task `SHOW MASTER STATUS` anymore, so a restart reuses the checkpointed value and cannot drift.
- New unit test `IncrementalSplitAssignerTest.shouldResolveLatestStopOffsetOnceAtSnapshotCompletionAndReuseAfterRestore` asserts: resolved once at snapshot completion (`verify(offsetFactory, times(2)).latest()`), and a restored assigner reuses the same offset (no re-resolution after restore).
**Issue 2 (CI-flaky E2E) — root-caused and fixed:**
- The failure was a readiness race: with a single-row table, the snapshot phase can complete before the `RUNNING` readiness signal is observed, so the post-readiness `UPDATE` landed after the (snapshot-completion-time) stop offset and was silently dropped.
- The test now bulk-inserts 200 rows before starting the job, making the snapshot phase of `initial`/`earliest` startups measurably non-trivial, so the `UPDATE` issued after `RUNNING` is guaranteed to land inside the snapshot window and be captured by the binlog phase. Verified locally: `testMysqlCdcInitialStartupWithLatestStop` + `testMysqlCdcEarliestStartupWithLatestStop` pass (2/2), and the full 7-test matrix (5 latest-stop combos + 2 existing specific-stop tests) passes.
**Issue 3 (unit coverage) — covered** by the new `IncrementalSplitAssignerTest` above.
Local verification for this head (`c58fc10c3`): `spotless:check` ✅, compile ✅, unit tests ✅, E2E 7/7 ✅. CI is re-running on the fork now — happy to address anything that comes 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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5385713634
Thanks for the very thorough round of review, @SEZ9 — this pushed me to re-verify my own round-2/round-3 conclusions against the actual source rather than trusting my earlier read, and the result is a mix: one of your findings turns out not to hold up, but another is a real gap I missed. Splitting it out:
**Issue 1 / Issue 6 (checkpoint serializer) — I don't think this holds up; pushing back with evidence**
Both issues are built on the premise that enumerator state is persisted through a hand-written, field-by-field `PendingSplitsStateSerializer` that this PR forgot to update. I searched the full `dev` tree (`git ls-tree -r --name-only dev` / GitHub tree API) for any file matching `*Serializer*` under `connector-cdc-base`'s `enumerator` package, and there is no such class anywhere in this module — and the PR's own changed-file list (7 files) doesn't touch one either, because none exists to touch.
What actually persists this state is plain Java serialization: `PendingSplitsState extends Serializable`, and `IncrementalPhaseState` (`.../enumerator/state/IncrementalPhaseState.java:26,29`) implements it directly via `@Data` with a `private static final long serialVersionUID = -6809026812298443356L` that the PR explicitly preserves unchanged (see the comment on it: "Preserve compatibility with checkpoints written when this state had no fields."). That's the correct, standard mechanism for this exact scenario: with the `serialVersionUID` held stable, `ObjectInputStream` reading an old stream (written before the `stopOffset` field existed) will default-initialize the missing field to `null` via normal Java field-evolution rules — no custom read/write logic is needed for that to work.
Given there's no serializer to bypass, `IncrementalSplitAssignerTest`'s restore test — constructing the `IncrementalPhaseState` from `snapshotState()` and passing it straight into the restore constructor — isn't skipping a persistence layer; that object graph *is* the checkpoint payload. So Issue 6's "the test can't detect data loss on a real round-trip" concern doesn't apply here either.
**Issue 2 (stale offset for the pre-resolution split, restore boundary drift) — you're right, and I missed this in rounds 2/3. Conceding with thanks.**
I re-traced the actual call order rather than relying on the author's explanation this time, and it confirms your read:
- `IncrementalSplitAssigner.completedSnapshotPhase()` (`IncrementalSplitAssigner.java:323-324`) is gated by `checkArgument(splitAssigned && noMoreSplits())` — it cannot run until `splitAssigned` is already `true`.
- `splitAssigned` only becomes `true` inside `getNext()` (`IncrementalSplitAssigner.java:139-146`), immediately after `createIncrementalSplits()` has already built the split(s) using whatever `resolvedStopOffset` held *at that moment* — which is still `null` the first time, so it falls through to the live `sourceConfig.getStopConfig().getStopOffset(offsetFactory)` (`IncrementalSplitAssigner.java:304-307`), a separate `latest()` call.
- `HybridSplitAssigner.getNext()` unlocks incremental allocation purely off `snapshotSplitAssigner.isCompleted()` (`HybridSplitAssigner.java:104`), and `SnapshotSplitAssigner.isCompleted()` flips via its own internal split-tracking bookkeeping (`SnapshotSplitAssigner.java:208`, `254-265`) — independent of, and typically earlier than, the enumerator receiving the reader's explicit `CompletedSnapshotPhaseEvent`, which is the only thing that triggers `IncrementalSplitAssigner.completedSnapshotPhase()` (`IncrementalSourceEnumerator.java:124-134`).
So the ordering isn't just possible, it's effectively the normal path with the default `incrementalParallelism`: `createIncrementalSplit()` resolves and hands the running reader one `latest()` value, then `completedSnapshotPhase()` resolves a second, later `latest()` value purely for the checkpoint. On restore, `createIncrementalSplit()` prefers the checkpointed `resolvedStopOffset` (`IncrementalSplitAssigner.java:304-307` again, this time non-null), so the post-restart split can stop at a materially different binlog position than the one the reader was actually running against pre-restart — which is exactly the class of restart-drift bug this PR exists to close, just triggered one step earlier than round 1's original report. I'd treat this as a blocking item alongside (really, in place of) Issue 1, not just a follow-up: e.g. resolving `resolvedStopOffset` once inside `createIncrementalSplit()` itself (guarded by `resolvedStopOffset == null`, same pattern already used in `comple
tedSnapshotPhase()`) so there's a single authoritative resolution point for both the live split and the checkpoint, as your suggested fix proposes.
I haven't independently re-verified Issues 3/4/5/7/8 in this pass — this reply is scoped to the two points above where the review's conclusion needed direct confirmation. @li3zhi4, given Issue 2 is confirmed real, I'd suggest prioritizing that fix; happy to take another full pass once it's addressed.
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5611986044
@SEZ9 fair ask — here are the concrete hunks at `befad345c`, re-verified by me just now against the raw files (not the summary):
**F1/F6** — `IncrementalPhaseState.java`: the field is `private final Offset stopOffset;` at line 39, with `serialVersionUID` unchanged at line 29. `IncrementalPhaseStateTest.java`:
- `shouldPreserveStopOffsetThroughJavaSerializationRoundTrip` (lines 35-47) builds a state with a non-null `stopOffset`, round-trips it through a real `ObjectOutputStream`/`ObjectInputStream` (the `roundTrip()` helper at lines 64-73), and asserts the value survives.
- `shouldDefaultStopOffsetToNullOnLegacySerializedState` (lines 50-62) constructs `IncrementalPhaseState` via the legacy single-arg constructor (no `stopOffset`), round-trips it the same way, and asserts `getStopOffset()` comes back `null` — this is the pre-upgrade-checkpoint case.
**F2** — `IncrementalSplitAssigner.java`: the guard is `if (resolvedStopOffset == null && sourceConfig.getStopConfig().getStopMode() == StopMode.LATEST)` at lines 329-330, inside `createIncrementalSplit()` (method starts line 265); `resolvedStopOffset` is declared at line 94 and restored from checkpoint state at line 124. The "only after snapshot completion" guarantee is in `HybridSplitAssigner.java#getNext()`, lines 100-113: it returns from `snapshotSplitAssigner` while `!snapshotSplitAssigner.noMoreSplits()` (100-103) or `Optional.empty()` while `!snapshotSplitAssigner.isCompleted()` (104-107), and only reaches `incrementalSplitAssigner.getNext()` (which is what calls `createIncrementalSplit()`) at line 113, after both gates pass.
**F5** — `IncrementalSplitAssigner.java#resolveLatestStopOffsetWithRetry()`, lines 389-414: `final int maxRetries = 3` (390), `Thread.sleep(300L * attempt)` (397, so 300ms then 600ms on attempts 1 and 2), final attempt rethrows wrapped as `SeaTunnelException` (406-410). Called from line 335.
**F3** — `MysqlCDCStopModeSpecificIT.java`, lines 419-422: `Assertions.assertNull(queryVarcharById(2000), "snapshot finished too early: last-chunk row already in sink; increase the initial bulk row count")`, gated behind the id=1 wait at lines 406-412.
**F4/F7/F8** — `docs/en/connectors/source/MySQL-CDC.md` diff hunk updates the `stop.mode` option-table row (the `latest` cell) and adds a new worked `hocon` example + explanatory paragraph right after the existing bounded-read note (`docs/zh` carries the equivalent edit). PR description's "Does this PR introduce any user-facing change?" section states the snapshot-completion semantics directly, and the `Docs updated` checkbox in the PR body is ticked (`- [x] Docs updated (...)`).
All of the above is me re-reading the actual file contents at `befad345c` just now, not re-quoting my own or li3zhi4's earlier prose — happy to point at anything else that's still unclear.
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "li3zhi4 (via GitHub)" <gi...@apache.org>.
li3zhi4 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5613387235
@SEZ9 Here are the concrete locations at `befad345c`:\n\n- **F1/F6** \u2014 `connector-cdc-base/src/test/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/state/IncrementalPhaseStateTest.java`:\n - Real-serialization round-trip: `shouldPreserveStopOffsetThroughJavaSerializationRoundTrip` (lines 34-47); the `roundTrip(...)` helper (lines 64-73) uses real `ObjectOutputStream`/`ObjectInputStream` over a `ByteArrayOutputStream` \u2014 the same mechanism the engine's `DefaultSerializer` \u2192 `SerializationUtils` uses, so it exercises the actual persistence path.\n - Pre-upgrade case: `shouldDefaultStopOffsetToNullOnLegacySerializedState` (lines 49-62) \u2014 simulates a checkpoint written before the `stopOffset` field existed via the single-arg constructor (exactly the call shape old versions persisted); with the unchanged `serialVersionUID`, Java field-evolution defaults the missing field to `null` on the real round-trip (asserted at line 61).\n - For context: `conn
ector-cdc-base` has no `PendingSplitsStateSerializer` class, and `IncrementalSource` has no `getEnumeratorStateSerializer` override \u2014 the engine uses the interface default `DefaultSerializer` \u2192 `SerializationUtils` (plain object streams).\n\n- **F2** \u2014 `IncrementalSplitAssigner.java`:\n - Guard: lines 329-343 \u2014 `if (resolvedStopOffset == null && sourceConfig.getStopConfig().getStopMode() == StopMode.LATEST) { resolvedStopOffset = resolveLatestStopOffsetWithRetry(sourceConfig); ... }`, then `incrementalSplitStopOffset = resolvedStopOffset != null ? resolvedStopOffset : ...` \u2014 one authoritative resolution point, cached, reused for every subsequent split.\n - Snapshot-completion ordering: `HybridSplitAssigner.getNext()` lines 98-117 \u2014 returns snapshot splits while `!snapshotSplitAssigner.noMoreSplits()`, returns empty while the snapshot assigner is not completed, and only reaches `incrementalSplitAssigner.getNext()` after completion (ordering constraint
in the comment at lines 110-112).\n - Checkpoint write: `snapshotState` line 227 (`new IncrementalPhaseState(startupOffset, resolvedStopOffset)`); legacy-checkpoint restore from an in-flight split: `addSplits` lines 210-216.\n\n- **F5** \u2014 `resolveLatestStopOffsetWithRetry()`, `IncrementalSplitAssigner.java` lines 389-414: `maxRetries = 3`, backoff `Thread.sleep(300L * attempt)` (300ms then 600ms), wrapped `SeaTunnelException` on final failure after `LOG.error`.\n\n- **F3** \u2014 `MysqlCDCStopModeSpecificIT.runLatestStopStartupMode` (lines 340-455): 2000-row bulk for `initial` (line 355); readiness gate = await `queryVarcharById(1) == \"bulk\"` (lines 406-412); defensive assertion `Assertions.assertNull(queryVarcharById(2000), \"snapshot finished too early: last-chunk row already in sink; increase the initial bulk row count\")` (lines 419-423), with a comment (lines 413-418) explaining it fails loudly instead of letting a post-UPDATE assertion failure masquerade as data loss.\
n\n- **F4/F7/F8** \u2014 `docs/en/connectors/source/MySQL-CDC.md`: `stop.mode` table row line 203, explanation + worked example at lines 543-559; `docs/zh/connectors/source/MySQL-CDC.md`: table row line 202, explanation + example at lines 535-551. The PR description's docs checklist item is already ticked (`- [x] Docs updated`).\n
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5628412228
Thanks @li3zhi4 — the pointers at `befad345c` are exactly what I needed.
On F1/F6: `shouldPreserveStopOffsetThroughJavaSerializationRoundTrip` (lines 34-47), the `roundTrip(...)` helper (lines 64-73) using real `ObjectOutputStream`/`ObjectInputStream`, and `shouldDefaultStopOffsetToNullOnLegacySerializedState` (lines 49-62) in `IncrementalPhaseStateTest` are the right shape for what I flagged. Your comment appears to have been cut off right after "`DefaultSerializer` → `Ser`" — could you post the rest of that paragraph? I'll then verify the test and the absence of a custom `PendingSplitsStateSerializer` / `getEnumeratorStateSerializer` override against the diff before marking F1/F6 resolved.
On the rest, I see the thread already points at the `resolvedStopOffset == null` guard at `IncrementalSplitAssigner.java:329-343` and `resolveLatestStopOffsetWithRetry` for F2/F5, the `MysqlCDCStopModeSpecificIT` assertion for F3, and the doc locations for F4/F7/F8. I'll check each of those against the diff myself rather than ask for them again, and will follow up if anything looks off. Once I have the tail of the F1/F6 note, I'll do a final pass.
<!-- streview-comment:953 -->
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5396361116
Quick follow-up on my approval above.
At the time I approved (commit a090452, same head as now), the fork's `Build` check was showing `FAILURE`, but the only failing test in that run was `PostgresCDCIT.testPostgresCdcSnapshotOnlyAndCommittedOffsetStartupModes`, an unrelated Postgres-CDC committed-offset/restore issue already tracked in #11847 (fix pending in #11864) - not caused by this PR's MySQL-only diff.
Since then, CI was rerun on this exact same head commit and the `Build` workflow now completes with `SUCCESS`. That confirms it was indeed just the known flake, not a regression introduced here, so my approval is now unconditional.
One thing still keeping `reviewDecision` at `REVIEW_REQUIRED`: @SEZ9's CHANGES_REQUESTED review was submitted against an earlier commit (a396320c). As I noted in my latest review, the current head already addresses that feedback. @SEZ9, whenever you get a chance, a re-review/dismissal on the current head would help move this toward merge - otherwise this just needs a maintainer with write access to give the formal sign-off.
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "li3zhi4 (via GitHub)" <gi...@apache.org>.
li3zhi4 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5390180456
Thanks to both @DanielLeens and @SEZ9 for the thorough round-3/round-4 reviews. All findings are now addressed on head `a09045249`; summary per issue:
**DanielLeens round-3 Issue 1 (NPE in `completedSnapshotPhase`, High)** — fixed. The `stop.mode=latest` resolution no longer lives in `completedSnapshotPhase()` at all (it moved into `createIncrementalSplit()`, see below), so the method no longer dereferences `context.getSourceConfig()`; `HybridSplitAssignerTest.testCompletedSnapshotPhase` additionally now supplies a mocked `SourceConfig` (`StopMode.NEVER`) to keep its intent explicit, matching the existing pattern in `IncrementalSplitAssignerTest`.
**SEZ9 Issue 2 / DanielLeens confirmation (single authoritative resolution point)** — fixed, and it also subsumes the NPE fix above. `createIncrementalSplit()` now resolves `latest()` exactly once (guarded by `resolvedStopOffset == null`) and reuses the same value for every subsequent split and for the checkpoint (`snapshotState`). The split handed to the reader and the checkpointed value can no longer diverge, so a restore cannot silently move the stop boundary — and the ordering concern you both traced (split created before `completedSnapshotPhase` runs) is gone because there is only one resolution point. Unit test updated to assert resolve-once (`times(1)`) and reuse-after-restore.
**SEZ9 Issue 1 / Issue 6 (checkpoint serialization)** — as @DanielLeens verified, `connector-cdc-base` has no hand-written `PendingSplitsStateSerializer`; enumerator state persists via plain Java serialization (`PendingSplitsState extends Serializable`), with `IncrementalPhaseState.serialVersionUID` deliberately unchanged so legacy checkpoints deserialize with `stopOffset = null` and fall through to the pre-existing resolution path. To close Issue 6 empirically rather than by argument, I added `IncrementalPhaseStateTest`: (a) a real `ObjectOutputStream`/`ObjectInputStream` round-trip preserves `stopOffset`; (b) a legacy single-arg state deserializes with `stopOffset == null`.
**SEZ9 Issue 3 (readiness gate not structural)** — addressed. Two changes: (1) the `initial` case now bulk-inserts 2000 rows (with `snapshot.split.size = 20` → 100 splits, parallelism=1, ascending-key order), so the sink-visibility gate (first row visible) can only fire while ~99 splits are still unread — the UPDATE is guaranteed to land inside the snapshot window without relying on a timing margin; (2) a defensive assertion right after the gate fails loudly with "snapshot finished too early: last-chunk row already in sink" if the whole snapshot ever completed before the gate fired, instead of letting the post-UPDATE assertion mislead as data loss. Note on the suggested row-lock stall: it is not usable here, because the snapshot reader issues a plain MVCC `SELECT * FROM ... WHERE id <= ?` (no `FOR SHARE`/`FOR UPDATE`), so an open `FOR UPDATE` transaction on a trailing row does not block it — I verified the generated SQL directly.
**SEZ9 Issue 4 (docs)** — done. `stop.mode = "latest"` snapshot-window semantics (stop offset resolved when the snapshot phase completes; changes written while the snapshot runs are not dropped) documented in `MySQL-CDC.md` (en/zh), in both the option table and a new Bounded-Read example; the PR checklist's docs item is now checked.
**SEZ9 Issue 5 (no exception handling on `latest()`)** — fixed. The resolution point retries with a short backoff (3 attempts, mirroring the CDC connection-factory retry pattern), so a transient DB failure at the snapshot-to-incremental transition no longer fails the whole job.
**SEZ9 Issue 7 / Issue 8 (PR description alignment)** — done. The PR description now describes the enumerator-side mechanism (`createIncrementalSplit()` / `IncrementalPhaseState.stopOffset`) and notes the fix applies to all `connector-cdc-base` connectors, not MySQL specifically; no reader-side attribution remains.
**Verification (local, head `a09045249`)**: `spotless:check` ✅; `connector-cdc-base` unit tests 71/71 ✅ (incl. new `IncrementalPhaseStateTest`); e2e 7/7 ✅ (initial+earliest 2/2, latest+specific+timestamp 3/3, existing specific-stop regression 2/2); `git diff --check` clean. The previously-failing `unit-test (11, ubuntu-latest)` NPE is fixed and no longer blocks CI. Happy to take another pass from either of you.
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "li3zhi4 (via GitHub)" <gi...@apache.org>.
li3zhi4 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-6165461271
@SEZ9 @nzw921rx — CI on current head `7f17332b7a` has now completed SUCCESS, and the Apache-side required Build is also green: https://github.com/li3zhi4/seatunnel/actions/runs/38382236864 . No new push to this branch is planned while you verify the mapped F1–F8 points.
The source-level pointer/evidence replies above remain applicable to this exact SHA. Please complete the final review and update/request the normal write-enabled approving review once satisfied; REVIEW_REQUIRED is the remaining merge gate. A green Build is not by itself a formal approval.
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo merged PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5595086864
@DanielLeens thanks for the detailed write-up and for tracing the rebase — that explains why `dc699a34b` is no longer reachable and what `befad345c` ("Repair test seam damaged by rebase conflict resolution") is for. Your comment looks truncated, though: it stops at "At `2026-09-08T05:07:10Z` the PR head was". Could you post the rest of that trace?
Mapping your description against my earlier review points, here is what I still need to see in the diff before I can close any of them:
- **PR11885-F1 / F6**: you describe the resolved offset as carried in `IncrementalPhaseState.stopOffset`, with `addSplits()` adopting the offset from an in-flight split for legacy checkpoints. My concern was that the field was not written/read by the checkpoint serializer and that the restore test in `IncrementalSplitAssignerTest` bypassed it. If `befad345c` touched the serializer or that test, a pointer to the relevant hunk would help.
- **PR11885-F2**: your explanation relies on `HybridSplitAssigner` only creating incremental splits after snapshot completion. I still want to confirm from the code that the `resolvedStopOffset == null` guard is the only path producing a stop offset for `latest` mode and that all splits from one assignment share the same cached value.
- **PR11885-F5**: you mention the resolution is retried with backoff. I have not yet seen where that lives or whether it is tested, so I'll leave this open until I can check the diff.
- **PR11885-F3**: not covered in your summary — do you know whether the readiness gate in `MysqlCDCStopModeSpecificIT` changed in the rebase?
- **PR11885-F4 / F7 / F8**: these concern the connector docs and the PR description; I'll verify them against the current PR body and diff rather than the summary here.
Once the rest of the trace is up I'll re-review the current head.
<!-- streview-comment:917 -->
--
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][Connector-CDC] Resolve stop.mode=latest stop offset at binlog phase start [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #11885:
URL: https://github.com/apache/seatunnel/pull/11885#issuecomment-5902647533
@li3zhi4 thanks for the nudge, and apologies for the delay on my side.
The location list you posted against `befad345c` gives me what I need to trace each point, including the F1/F6 note that `connector-cdc-base` has no dedicated `PendingSplitsStateSerializer` and `IncrementalSource` does not override `getEnumeratorStateSerializer`, so the `IncrementalPhaseStateTest` round-trip through the default `DefaultSerializer` → `SerializationUtils` path is the persistence path to exercise. I'll read those hunks against the diff before I sign off, as I said earlier.
Since the head has moved to `b0ab23fb03`, I'll do that read on the current diff so I'm looking at the same code that would merge: the F1/F6 test, the F2/F5 guard in `IncrementalSplitAssigner`, the F3 assertion in `MysqlCDCStopModeSpecificIT`, and the F4/F7/F8 doc/description updates. Good to hear the sync with `upstream/dev` was conflict-free.
Nothing further needed from you at this point; I'll post my final confirmation here once I've been through the `b0ab23fb03` diff.
<!-- streview-comment:1408 -->
--
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