Repository navigation
[Test][E2E] Validate MySQL CDC progress reporting - #12137
goutamadwant wants to merge 72 commits into
Conversation
Signed-off-by: Goutam Adwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
…gress-v2 Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: Goutam Adwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
…rogress-v2 Signed-off-by: goutamadwant <workwithgoutam@gmail.com> # Conflicts: # seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/CoordinatorService.java
…rogress-v2 Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Fall back to UNKNOWN when the dialect has no name instead of failing reader construction, and list OceanBase CDC and openGauss CDC as inheriting the progress wiring.
…rogress-v2 # Conflicts: # seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/reader/IncrementalSourceReader.java # seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/SeaTunnelServer.java
Since apache#12321 the checkpoint schema is only restored when the job propagates schema changes, so the test now uses a JDBC source config with schema-changes enabled.
…progress-validation
Reader progress is now sampled at most once per second. If the batch ran within a second of the last sample, none of its records was sampled and the reported position never moved, so the test timed out.
DanielLeens
left a comment
There was a problem hiding this comment.
Hi @goutamadwant, thanks for keeping this updated. This is a scheduled re-review since a new commit landed after my last comment — I read everything posted since then (your Sept 20 comment, @SEZ9's Sept 21 comment, and my own Sept 22 follow-up) before doing a full pass on the current head, and I'm combining that reply with the fresh review below in one submission per our process.
One thing up front, and I owe you an apology for it: in my original Sept 6 review I rated this test Stable based on its Awaitility-only style. That rating missed a real race — the exact one your Sept 28 commit f1b5eec fixes (Reader progress is sampled at most once per second... none of its records was sampled and the reported position never moved, so the test timed out). That's a genuine intermittent-timeout risk in the incremental-DML assertion I should have flagged back then instead of calling it clean. Sorry for missing this the first time — marking it a carryover below, now resolved by your commit, with one follow-up suggestion on how the fix is expressed.
What Problem Does This PR Solve?
- User pain point: SeaTunnel's MySQL CDC source/engine reports snapshot and incremental progress internally (via the not-yet-merged CDC progress-reporting foundation, #11512), but that machinery has never been exercised end-to-end against a real MySQL instance and a real multi-node Zeta cluster.
- Fix approach:
MysqlCdcProgressIT— a real two-node (master + worker) embedded Zeta cluster test against a real MySQL 8.0.36 container, driving snapshot, incremental insert/update/delete, and job-cancellation cleanup, with a strong cross-check against a realSHOW MASTER STATUSbinlog boundary. - One-sentence summary: The test design itself is solid and, as of the newest commit, correctly accounts for the underlying progress-sampling throttle — but the PR is still an explicit draft whose diff against
devbundles the entire unreviewed foundation PR #11512, which is still open and unmerged as of this re-review.
1. Code Change Review
1.1 Core Logic Analysis
Scope is unchanged from my last review: the PR's own description states only three files belong to this follow-up — MysqlCdcProgressIT.java, mysql_cdc_progress_template.conf, and the connector-seatunnel-e2e-base/pom.xml test-dependency addition. I re-verified this against the current diff: git diff origin/dev...HEAD still shows ~60 files, the bulk of which (the new seatunnel-api/.../cdc/* model classes, CdcProgressService/CdcProgressEnvelope/CdcProgressOwner, wiring in CoordinatorService, SeaTunnelServer, TaskExecutionService, SourceSplitEnumeratorTask, SourceFlowLifeCycle, SourceSeaTunnelTask, new RPC operations, and the docs/en|zh/developer/cdc-progress.md pages) come from #11512, which gh pr view 11512 confirms is still OPEN/mergedAt: null. That is the same root cause I flagged before — GitHub diffs this branch against dev, not against #11512's branch.
What actually changed in the owned scope since my last comment (Sept 22): one commit, f1b5eec — "Wait out the progress sampling interval before the DML batch," touching only MysqlCdcProgressIT.java (+6/-0). Before/after:
// before (as of my Sept 22 comment)
BinlogOffset batchStart = currentBinlogEnd();
Assertions.assertTrue(new BinlogOffset(beforePosition).isBefore(batchStart), ...);
log.info("Checking insert, update, and delete with incremental progress for job {}", jobId);
executeSql("UPDATE ... ", "DELETE ...", "INSERT ...");// after (current head, MysqlCdcProgressIT.java:201-206)
BinlogOffset batchStart = currentBinlogEnd();
Assertions.assertTrue(new BinlogOffset(beforePosition).isBefore(batchStart), ...);
// Reader progress is sampled at most once per second. Let that interval pass so the
// batch's first record is sampled; nothing else emits afterwards to refresh it.
long lastSampleAt = before.getReport().getLastPositionChangeAt();
Awaitility.await()
.atMost(1, TimeUnit.MINUTES)
.until(() -> System.currentTimeMillis() - lastSampleAt >= 1500);
log.info("Checking insert, update, and delete with incremental progress for job {}", jobId);
executeSql("UPDATE ... ", "DELETE ...", "INSERT ...");I traced why this fix is correct: CdcReaderProgressTracker.shouldRecordEmission() (.../connector-cdc-base/.../progress/CdcReaderProgressTracker.java:76-83) gates publication of a new position to at most once per PUBLICATION_INTERVAL_NANOS (= 1s, line 38) unless the split or lifecycle changes. Because the test's final DML batch is the only subsequent event and nothing re-triggers the tracker afterward, if that batch landed inside the same 1-second throttle window as the previous sample, its position would never be published and the outer Awaitility.await(2, MINUTES).untilAsserted(...) at line 214 would poll forever against a frozen readerReport() until timing out — exactly matching the failure described in the commit message. The fix correctly waits past the throttle window using Awaitility (not a raw Thread.sleep), so it doesn't add an unconditional pause — it's a bounded, self-terminating poll that in practice always takes ~1.5s.
Key findings:
- Snapshot-before-incremental ordering is handled correctly: the test waits for
awaitRows(...)on both source and sink and for the enumerator'sCdcSnapshotAssignmentStatus.COMPLETEDreport (lines 175-183) before injecting the first incremental INSERT — this avoids the common CDC E2E race of asserting incremental state while the snapshot phase is still draining. - The binlog cross-check (
currentBinlogEnd()/BinlogOffset.isAtOrAfter/isBefore, backed byOffset.isBefore/isAtOrAfterinconnector-cdc-base/.../offset/Offset.java:66,70) ties the assertion to genuine MySQL coordinates rather than "some counter increased," which is meaningfully stronger than typical progress tests. - Post-cancellation cleanup assertion (
progress.getReaderReports(...).isEmpty()andgetEnumeratorReport(...) == null, lines 252-262) is a real regression guard against a progress-store leak on job cancellation. - Container readiness is sound:
MySQLContaineruses Testcontainers' JDBC-connect wait strategy (not a log-keyword or "container up" check), so "ready" here really means "ready to serve queries," andnetwork.setPort(0)avoids hard-coded-port collisions under parallel CI. @AfterEach closeResources()usesAssertions.assertAll(...)with null-guards plus afinallyrestoringCommon.setDeployMode(...)— no leaked containers/instances across runs even if an assertion earlier in the test failed.
1.2 Compatibility Impact
Unchanged from my last review: not independently assessable while bundled with #11512. Once #11512 merges and this branch is rebased to its real three-file scope, this PR itself introduces no new production dependency, API, or config default — only test-scope Maven dependencies (connector-cdc-base, connector-cdc-mysql, confirmed via git diff origin/dev...HEAD -- .../pom.xml) and a test class/resource.
1.3 Performance / Side-Effect Analysis
Test-only, no production impact. The debezium.heartbeat.interval.ms = 0 setting in the job template disables synthetic heartbeat events by design, so the only source of position advancement is real DML — which is why the sampling-interval wait in 1.1 matters here specifically (there's no heartbeat filler to otherwise nudge the tracker past its throttle window).
1.4 Error Handling and Logging
Issue 1 (Location: whole diff / PR-level, not a single file — carryover, unchanged, High, raised by Daniel Sept 6 & Sept 22, and independently by @SEZ9 Sept 21): The PR remains a draft; its own checklist still has "Complete supported CI and broader engine classpath validation" and "Reconcile with merged #11512 ... before marking ready" unchecked, and gh pr view 11512 confirms #11512 is still open/unmerged. Merging this PR today would merge #11512's entire unreviewed production surface as a side effect of what's titled [Test][E2E]. Must stay blocked until #11512 lands on dev and this branch is rebased to its owned three-file diff.
Issue 2 (Location: MysqlCdcProgressIT.java:201-206, new in this commit, Medium, not raised by another reviewer): The new wait hardcodes 1500 ms as "safely past the 1-second publication interval," but that interval is a private implementation constant (PUBLICATION_INTERVAL_NANOS, CdcReaderProgressTracker.java:38) that this E2E test module has no compile-time link to. If that constant is ever changed (e.g., widened for overhead reasons) in a future PR to that class, this test will silently regress into the exact same intermittent-timeout failure this commit was written to fix, and nobody touching that unrelated file would think to update this test. Best improvement: expose the interval for test reuse — e.g. a @VisibleForTesting accessor/constant on CdcReaderProgressTracker, or a shared constants class both the tracker and the E2E test depend on — so the test's wait is derived from the real value instead of a duplicated magic number. Non-blocking for this PR's own scope, but worth fixing before/alongside #11512 since that's the file that actually owns the constant.
2. Code Quality Assessment
2.1 Coding Standards
The three owned files remain clean: license headers present, class-level Javadoc on MysqlCdcProgressIT, private helpers (assertSnapshotCompleted, readerReport, assertIncremental, currentBinlogEnd) clearly named, and the new comment at lines 201-202 explains why the wait exists, not just what it does. No missing-comment findings.
2.2 Test Coverage and Test Stability
Mandatory stability check (flaky-test anti-patterns):
- No raw
Thread.sleepanywhere in the file — all waits go throughAwaitility. - Container readiness uses a real JDBC-connect wait strategy, not a log-keyword check.
- No hard-coded ports (
network.setPort(0)); cluster name is derived from@TempDir's unique path, avoiding cross-run collisions. - Resource cleanup is unconditional via
@AfterEach+finally(see 1.1). - Snapshot-completion is explicitly gated before incremental assertions begin (see 1.1) — the common CDC E2E race is handled correctly.
- The one real anti-pattern is Issue 2 above: the new
Awaitility.await().until(() -> System.currentTimeMillis() - lastSampleAt >= 1500)is, functionally, a bounded wall-clock wait rather than a wait on an actual state transition — it's dressed as a poll but its condition is pure elapsed time. It's the right fix for the underlying throttle (see 1.1's trace), and it's self-terminating (1-minute cap) rather than an unconditional sleep, so I'm not calling it a blocker — but it is exactly the kind of "assertion dependent on wall-clock time" this checklist exists to catch, and as noted in Issue 2 it re-couples this test to an unreferenced internal constant. - I could not confirm a green CI run for the current head: the fork's
Buildworkflow forf1b5eec3fdis stillqueuedas of this review (goutamadwant/seatunnelactions run 36472849888), and the mirroredapache/seatunnel"Build" check showsIN_PROGRESS/pending. My Sept 6 review's CI citation was for an earlier commit and should not be read as still applying to this head — I'm flagging that explicitly rather than assuming carryover green status.
Stability rating: Risk present — no active flakiness observed in the owned test logic itself, but the elapsed-time-based wait (Issue 2) is a real anti-pattern that already caused one intermittent timeout in this PR's history and could recur if the underlying constant drifts, and I don't yet have a completed CI run on the current head to independently confirm the fix works end-to-end.
2.3 Documentation Updates
docs/en/developer/cdc-progress.md / zh counterpart remain part of the bundled #11512 diff, not this PR's owned scope — should be reviewed/reconciled as part of that PR, consistent with my prior review.
3. Architectural Soundness
3.1 Elegance of the Solution
Precise fix for what it claims to be, and the new commit shows real engineering care — root-causing a throttle-related race rather than papering over it with a generic longer timeout or a retry-until-pass loop. Still not in a mergeable shape as a standalone PR (see Issue 1).
3.2 Maintainability
Good overall; Issue 2 is the only maintainability wrinkle — a duplicated magic number instead of a shared constant across modules.
3.3 Extensibility
Unchanged from before: the embedded two-node cluster + real source container + direct CdcProgressService access pattern remains a reasonable template for future CDC-connector progress tests (PostgreSQL, multi-table, heartbeat, recovery, per the PR's stated follow-ups).
3.4 Historical-Version Compatibility
Not user-facing; no impact on existing tasks, configs, or checkpoint/restore semantics.
4. Issue Summary
| Number | Issue | Location | Severity |
|---|---|---|---|
| 1 | PR is a draft bundling the entire unreviewed, still-open foundation PR #11512 into a diff titled [Test][E2E]; must not merge until #11512 lands and this branch is rebased to its real 3-file scope |
Whole PR / diff-against-dev |
High |
| 2 | New elapsed-time wait (MysqlCdcProgressIT.java:201-206) hardcodes a 1500ms buffer tied to CdcReaderProgressTracker.PUBLICATION_INTERVAL_NANOS without referencing that constant; future changes to the interval will silently reintroduce the intermittent timeout this commit just fixed |
MysqlCdcProgressIT.java:201-206 (constant defined at CdcReaderProgressTracker.java:38) |
Medium |
5. Merge Recommendation
Conclusion: Not recommended for merge (in its current form)
-
Blockers — must be fixed:
- Issue 1 (High): Land #11512 first, then rebase this branch so the diff against
devis limited to the three files this PR actually owns, and take it out of draft once that's done. This is unchanged from my last two reviews — I re-verified via the GitHub API that #11512 is still open/unmerged as of this re-review, so this blocker has not been resolved by the new commit.
- Issue 1 (High): Land #11512 first, then rebase this branch so the diff against
-
Recommended fixes — non-blocking:
- Issue 2 (Medium): derive the E2E wait from the real
PUBLICATION_INTERVAL_NANOSconstant instead of a duplicated1500magic number, once #11512's tracker code is in a shape where that can be exposed.
- Issue 2 (Medium): derive the E2E wait from the real
Overall assessment: The new commit is a genuine, well-reasoned fix for a real timing race, and I'm glad to formally note the carryover: I should have caught this exact throttle-vs-single-batch race in my original Sept 6 review instead of rating the test unconditionally "Stable" — that's on me, and thanks for finding and fixing it properly (root-causing via the tracker's sampling contract) rather than just widening a timeout. The only thing still standing between this and a clean merge is the same process/sequencing issue as before: it needs #11512 to land and this branch to be rebased down to its owned scope. I'll take another look as soon as that happens.
…ogress-validation
…rogress-v2 # Conflicts: # seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java
…progress-validation
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for keeping this draft current, @goutamadwant. The head moved to 003ba3461 through three merges from dev, so I re-read the full diff and re-checked the current head rather than only the merge delta. Short version: the test you own is unchanged and its own CI is green, and the one blocker from my last review (the sequencing on #11512) is still the only thing standing between this and a clean merge.
What Problem Does This PR Solve?
- User pain point: the CDC progress-reporting machinery from #11512 has not been exercised end to end against a real MySQL and a real multi-node Zeta cluster.
- Fix approach:
MysqlCdcProgressITruns a two-node embedded Zeta cluster against a MySQL 8.0.36 container and drives snapshot, incremental insert/update/delete and cancellation cleanup, cross-checking against a real binlog boundary. - One-sentence summary: the E2E validation slice for CDC progress reporting, which depends on a foundation PR that has not merged.
1. Code Change Review
1.1 Core Logic Analysis
- Owned scope unchanged. There are no non-merge commits since my last review (
f1b5eec3f) that are not already indev, andgit diffofMysqlCdcProgressIT.java,mysql_cdc_progress_template.confandconnector-seatunnel-e2e-base/pom.xmlbetweenf1b5eec3fand this head is empty. The three merges only bring indev(and the #11512 branch merged withdev); the diffs I saw inServerConfigOptions.java,TaskExecutionServiceTest.javaand the Postgres test files aredevcontent. - Normal path still reaches the changed logic:
MysqlCdcProgressIT-> embedded Zeta cluster -> MySQL CDC source ->CdcReaderProgressTracker(publishes at most once perPUBLICATION_INTERVAL_NANOS, 1s) ->CdcProgressService. The test's 1.5s wait before the final DML batch is still what keeps the throttle from hiding the last sample; nothing in it changed. - Root-cause status of the blocker: #11512 is still open, and GitHub now shows it as having conflicts with
devas well, so this draft cannot be reduced to its three owned files yet. This PR is also reported as having conflicts withdev(mergeable statedirty); that is expected while it carries the foundation diff, and I would resolve it once, on the #11512 branch, then rebase this branch.
1.2 Compatibility Impact
Fully compatible: test-only in its owned scope; no effect on existing tasks, configs or checkpoint/restore. The bundled foundation code is reviewed under #11512, not here.
1.3 Performance / Side-Effect Analysis
Test-only: one container pair and an embedded cluster, all closed in finally as before. No change.
1.4 Error Handling and Logging
No change from my last review.
2. Code Quality Assessment
2.1 Coding Standards
Unchanged and good.
2.2 Test Coverage and Test Stability
Rating: Risk present (unchanged): the elapsed-time wait at MysqlCdcProgressIT.java:201-206 hardcodes 1500ms against the 1s PUBLICATION_INTERVAL_NANOS without referencing it (Issue 2).
2.3 Documentation Updates
The bundled docs/en|zh/developer/cdc-progress.md belong to #11512.
3. Architectural Soundness
Precise fix for what it claims to be; a good template for later CDC progress tests. Historical-version compatibility: no impact.
CI on this head (fork run 37266117889)
- Green: Code style, License header, unit-test (JDK 8/11, ubuntu and windows), and
mysql-cdc-connector-iton JDK 8 and 11, so the owned test passed on this exact head. - Red:
engine-v2-iton JDK 8 only (JDK 11 passed). The two failing tests areBackpressureSlowSinkIT.testCheckpointsKeepCompletingUnderSustainedBackpressure(zero additional checkpoints observed in the 90s window) andSplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck(timeout waiting for a cancel to resolve). Neither is in the file this PR owns, and the signatures match the issues addressed by the open PRs #12316 (source checkpoint lock handed to barrier injectors) and #12311 (CANCELING vertex resolved to CANCELED when its worker is lost). This is my inference from the failure text and those PR titles; because the bundled #11512 code touches the engine, I cannot fully rule out an interaction from the logs alone, so a rerun of that single job is worth doing once the branch is rebased.
4. Issue Summary
| # | Issue | Location | Severity |
|---|---|---|---|
| 1 | Draft bundles the unmerged #11512 foundation in a diff titled [Test][E2E]; must wait for #11512 and then be reduced to its three files |
whole PR | High |
| 2 | 1500ms elapsed-time wait duplicates the tracker's 1s publication interval | MysqlCdcProgressIT.java:201-206 |
Medium |
5. Merge Recommendation
Conclusion: Not recommended for merge (in its current form)
- Blockers - must be fixed: Issue 1. Land #11512 first (it currently needs its own conflict resolution against
dev), then rebase this branch so the diff is limited to the three owned files, and take it out of draft. - Recommended fixes - non-blocking: Issue 2, once the tracker constant can be referenced from the test.
Nothing new from other reviewers on this PR since the discussion on 20-22 September, which I agreed with at the time, so I have nothing to add or retract there. There is no new source defect on this head; the blocker is purely sequencing. Thanks again, and happy to re-check as soon as #11512 lands.
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: Goutam Adwant <workwithgoutam@gmail.com>
DanielLeens
left a comment
There was a problem hiding this comment.
Hi @goutamadwant, thanks for keeping this draft in sync. The head moved to adebfd95a (a merge of dev plus a sync with the latest #11512 branch), so I re-read the full diff and re-checked the current head instead of only looking at the merge delta. Short version: the three files this PR owns are unchanged, my earlier conclusion stands, and no new source-side issue showed up.
What Problem Does This PR Solve?
- User pain point: the CDC progress-reporting machinery from #11512 has not been exercised end to end against a real MySQL and a real multi-node Zeta cluster.
- Fix approach:
MysqlCdcProgressITruns a two-node embedded Zeta cluster against a MySQL 8.0.36 container and drives snapshot, incremental insert/update/delete and cancellation cleanup, cross-checking the reported binlog position against a real binlog boundary. - One-sentence summary: the E2E validation slice for CDC progress reporting, which still depends on a foundation PR that has not merged.
1. Code Change Review
1.1 Core Logic Analysis
- Owned scope unchanged.
git diffofMysqlCdcProgressIT.java,mysql_cdc_progress_template.confandconnector-seatunnel-e2e-base/pom.xmlbetween my last reviewed head (003ba3461) and this head is empty. Everything else that moved comes fromdev(for example #12454 touchingTaskExecutionService, the PG CDC base work, format/transform changes) or from the #11512 branch. - Runtime path (unchanged).
MysqlCdcProgressITstarts master + worker, submits the MySQL-CDC-to-JDBC job, then pollsCdcProgressServicereports through Awaitility for snapshot completion, incremental DML progress, native binlog position and post-cancel cleanup. The normal user path of a CDC job reaches this logic only through the progress foundation from #11512, which is why the sequencing matters. - Compatibility: fully compatible for this slice (tests and test-scope dependencies only). The compatibility story of the foundation itself belongs to #11512.
1.2 Test Stability
- Rating: Stable for the owned test. Waits are condition-based (Awaitility) and the earlier one-second progress sampling race was already addressed in
f1b5eec. I did not find new hard sleeps, fixed ports or order dependencies in the owned files. - Residual risk: the test needs Docker plus a two-node cluster, so only the real CI run on a clean rebased head will prove it on shared runners.
2. Status of the Remaining Blocker
- Issue 1 (carried over, unchanged): sequencing on #11512. GitHub still shows 65 changed files and about 8000 added lines against
devbecause #11512 is not merged, so this PR cannot be reviewed or merged as the three-file slice described in the description. #11512 is still open and not yet approved by a write-access maintainer. - CI: the
Buildcheck on this head was still in progress when I looked, so I can not call CI green yet.mergeStateStatusisBLOCKED(review required, draft).
3. Merge Recommendation
Conclusion: Not recommended for merge (yet)
- Blockers - must be fixed
- Issue 1: land #11512 first, then rebase so the diff is only the three owned files, mark the PR ready, and let CI finish green on that head.
- Recommended fixes - non-blocking
- None new in this round.
Overall: the test itself looks solid and I have no code-level change request for it. Happy to do a quick pass again as soon as #11512 lands and this is rebased. Thanks again for the careful work!
DanielLeens
left a comment
There was a problem hiding this comment.
Re-reviewed at current head 24becb9d38 (verified immediately before posting).
I reviewed the validation slice separately from its unmerged foundation #11512. Its owned delta is the MySQL CDC test, its template, and test-scope CDC dependencies. The test deliberately uses a split master/worker, proves snapshot completion, then verifies the worker report advances across insert/update/delete using native binlog coordinates rather than report timing alone. It also asserts both reader and enumerator reports are purged after cancellation. This is a meaningful regression test for the intended transport and lifecycle boundaries; I found no source-level defect in that validation delta.
However, this remains a dependent draft: its current dev...head comparison embeds the full #11512 implementation, so it must not merge before #11512 lands and this branch is rebased/reconciled against current dev. The required Build is also TIMED_OUT; a fresh successful Build after that reconciliation is required.
Conclusion: test slice looks sound, but not mergeable in its current stacked/CI state. COMMENT review only because my reviewer account is read-only.
|
A merge-state follow-up so the earlier conclusion does not hide the current gate: GitHub now reports merge conflicts ( Please sync the latest This remains stacked on #11512 and marked draft: please keep that prerequisite merge order, reconcile the branch after #11512 lands, and then let the required checks run. The earlier test-slice conclusion is not an approval of the embedded prerequisite implementation. Thanks for following through on this; a write-capable maintainer will still need to perform the final approval/merge step. |
Preserve the upstream source-enumerator serializer ID and retain CDC progress services and reader regression coverage. Signed-off-by: Goutam Adwant <workwithgoutam@gmail.com>
Retain the validated foundation serializer IDs and the existing MySQL CDC E2E-only changes. Signed-off-by: Goutam Adwant <workwithgoutam@gmail.com>
Signed-off-by: Goutam Adwant <workwithgoutam@gmail.com>
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks @goutamadwant for syncing again and resolving the conflict I flagged on 2026-10-22. GitHub no longer reports a merge conflict, and the branch is 0 commits behind dev. This is a full re-read at head 2ea178a8d282. Since my last review at 24becb9d38, the head has moved only through merges: dev into the #11512 branch, and that branch into this one. The three files this PR owns (MysqlCdcProgressIT.java, mysql_cdc_progress_template.conf, connector-seatunnel-e2e-base/pom.xml) have zero diff between the two heads, so my source-level conclusion on the validation slice is unchanged.
What Problem Does This PR Solve?
- User pain point: the CDC progress-reporting foundation from #11512 has no end-to-end proof against a real MySQL and a real split master/worker Zeta cluster.
- Fix approach:
MysqlCdcProgressITstarts an embedded master plus worker and runs a MySQL-CDC to JDBC job against MySQL 8.0.36. It checks the enumerator's snapshot-completion report, then the reader's incremental reports across insert/update/delete against a native binlog boundary taken fromSHOW MASTER STATUS, and finally that both reports are purged after cancellation. - One-sentence summary: the E2E validation slice for CDC progress reporting. It still sits on top of the unmerged #11512.
1. Code Change Review
1.1 Core Logic Analysis
- Owned scope (unchanged): test code, one job template, and two test-scope dependencies (
connector-cdc-base,connector-cdc-mysql). No production code belongs to this PR. - What the test proves: it requires the enumerator to run on the worker (
sourceCoordinator.getCurrentExecutionAddress()equals the worker's address), so reports really travel to the master. It compares binlog coordinates (BinlogOffset.isAtOrAfter(batchStart)) instead of relying only on report timing or sequence. It keeps the execution attempt fixed while the sequence must increase, and it waits out the 1 s sampling interval before the final DML batch, which was the race fixed inf1b5eec3. - Stacking state:
dev...headstill shows 65 files and about 8,000 added lines, because the whole #11512 implementation is embedded. #11512 is still open, and its current head9170d5e78ais one docs-only commit (Javadoc onCdcEnumeratorProgressReportconstructors) ahead of what is merged here. That does not affect this slice, but it shows the stacked copy will keep drifting until the foundation lands.
Runtime path exercised by the test:
MySQL binlog -> MySQL-CDC reader (worker) -> CDC progress report (reader / enumerator owner)
-> collection transport worker -> master -> CdcProgressService.getReaderReports / getEnumeratorReport
-> job.cancelJob() -> execution-scoped cleanup purges both reports
1.2 Compatibility Impact
Fully compatible for this slice (tests and test-scope dependencies only). The compatibility of the foundation itself is reviewed in #11512.
1.3 Performance / Side-Effect Analysis
None at runtime. In CI, adding connector-cdc-mysql to the connector-seatunnel-e2e-base test classpath widens that module's classpath for every engine IT. The "broader engine classpath validation" item in your own checklist is the right place to confirm this has no side effect.
1.4 Error Handling and Logging
Issue 1: stacked on unmerged #11512 (carryover)
- Location: PR scope (
dev...head: 65 files, foundation commits from #11512) - Problem: the PR cannot be reviewed or merged as the three-file slice it describes until #11512 lands.
- Risk: merging now would bring in the entire foundation through a side door, without that PR's own review gate.
- Best improvement: land #11512 first, then rebase so the diff contains only the three owned files, mark the PR ready, and get a green
Buildon that head. - Severity: High (sequencing, which you already acknowledge in the description)
- Raised by another reviewer: Yes, @SEZ9 (2026-09-21) asked for the same sequencing.
No other issues found in the owned files.
2. Code Quality Assessment
2.1 Coding Standards
License headers are present, the class Javadoc explains the purpose, and comments explain the why (sampling interval, GTID omission, pruned snapshot metadata).
2.2 Test Coverage and Test Stability
Every wait is condition-based (Awaitility with 1-2 minute bounds). Ports are ephemeral (setPort(0)), the cluster name is per test, checkpoints go to a @TempDir, and @AfterEach restores the static DeployMode. Stability rating: Stable by source review. The residual risk is runtime only: Docker plus a two-node cluster on shared runners, which only a CI run on the rebased head can prove.
2.3 Documentation Updates
None needed for a test-only slice.
3. Architectural Soundness
3.1 Elegance
Long-term solution: a real-system regression test with no synthetic reports or test-only production endpoints.
3.2 Maintainability
Good. Assertions are grouped into named helpers, and the single-table, single-reader scope is stated explicitly.
3.3 Extensibility
Multi-table, heartbeat, recovery and PostgreSQL scenarios can reuse the same fixture, as listed in your follow-ups.
3.4 Historical-Version Compatibility
Not applicable (test-only).
4. Issue Summary
| Number | Issue | Location | Severity |
|---|---|---|---|
| 1 | Stacked on unmerged #11512; diff is not yet the three-file slice | PR scope | High |
5. Merge Recommendation
Conclusion: Not recommended for merge
Blockers (must fix)
- Issue 1: wait for #11512 to merge, then rebase to the three owned files and mark the PR ready.
CI: the fork Build run for this head (goutamadwant/seatunnel run 40065642220) is still queued, so there is no result yet. A green run on the rebased head is the one that will count.
Recommended fixes (non-blocking): none.
Overall assessment: the validation test is careful and meaningful, and I have no code change to request in it. It is blocked only by sequencing. I will do a quick final pass as soon as #11512 lands and this branch is rebased. Thanks for keeping it in sync!
Signed-off-by: Goutam Adwant <workwithgoutam@gmail.com>
Signed-off-by: Goutam Adwant <workwithgoutam@gmail.com>
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for keeping this one moving, @goutamadwant. The head was updated only by merges of the #11512 foundation branch into this one (three new commits: a Javadoc clarification in CdcEnumeratorProgressReport.java, a unit-test ordering fix in SnapshotSplitAssignerTest.java, and the merge commit). I re-verified the full diff and the call chain against the new head cf2753195161, not only the delta.
What Problem Does This PR Solve?
- User pain point: the CDC progress-reporting foundation from #11512 has no end-to-end proof against a real MySQL and a real split master/worker Zeta cluster.
- Fix approach:
MysqlCdcProgressITstarts an embedded master plus worker and runs a MySQL-CDC to JDBC job against MySQL 8.0.36. It checks the enumerator's snapshot-completion report, then the reader's incremental reports across insert/update/delete against a native binlog boundary fromSHOW MASTER STATUS, and finally that both reports are purged after cancellation. - One-sentence summary: the E2E validation slice for CDC progress reporting, still sitting on top of the unmerged #11512.
1. Code Change Review
1.1 Core Logic Analysis
- Owned scope (unchanged since my last review):
MysqlCdcProgressIT.java,mysql_cdc_progress_template.confandconnector-seatunnel-e2e-base/pom.xml(two test-scope dependencies,connector-cdc-baseandconnector-cdc-mysql). The compare between my last reviewed commit2ea178a8and this head lists none of these three files, so my source-level conclusion on the validation slice is unchanged. No production code belongs to this slice. - The test requires the enumerator to run on the worker, so reports really travel to the master; compares binlog coordinates (
BinlogOffset.isAtOrAfter(batchStart)) rather than relying only on timing; keeps the execution attempt fixed while the sequence must increase; and waits out the 1 s sampling interval before the final DML batch. - Stacking state:
dev...headis still about 70 files because the whole #11512 implementation is embedded. #11512 is still open (its head is122d0af5), so this stacked copy keeps drifting (the two foundation edits above are examples). The newSnapshotSplitAssignerTestedit moves theaddSplitsBackcall after chunk discovery is released and documents that add-back shares the run monitor, which is consistent with the foundation code I reviewed in #11512; it is not part of this slice.
Runtime path exercised by the test:
MySQL binlog -> MySQL-CDC reader (worker) -> CDC progress report (reader / enumerator owner)
-> report transport worker -> master -> CdcProgressService.getReaderReports / getEnumeratorReport
-> job.cancelJob() -> execution-scoped cleanup purges both reports
1.2 Compatibility Impact
Fully compatible for this slice (tests and test-scope dependencies only). Compatibility of the foundation itself is covered in #11512.
1.3 Performance / Side-Effect Analysis
None at runtime. In CI, adding connector-cdc-mysql to the connector-seatunnel-e2e-base test classpath widens that module's classpath for every engine IT; a green full run of that module is the way to confirm there is no side effect.
1.4 Error Handling and Logging
Issue 1: stacked on unmerged #11512 (carryover)
- Location: PR scope (
dev...head, foundation commits from #11512) - Problem: the PR cannot be reviewed or merged as the three-file slice it describes until #11512 lands.
- Risk: merging now would bring the whole foundation in through a side door, without that PR's own review gate.
- Best fix: land #11512 first, rebase so the diff contains only the three owned files, mark the PR ready, and get a green
Buildon that head. - Severity: High (sequencing, which the description already acknowledges)
- Raised by another reviewer: Yes, @SEZ9 (2026-09-21) asked for the same sequencing.
No other issues found in the owned files.
2. Code Quality Assessment
2.1 Coding Standards
License headers present, class Javadoc explains the purpose, and comments explain the why (sampling interval, GTID omission, pruned snapshot metadata).
2.2 Test Coverage and Test Stability
All waits are condition-based (Awaitility with bounded timeouts), ports are ephemeral, the cluster name is per test, checkpoints go to a @TempDir, and @AfterEach restores the static DeployMode. Stability rating: Stable by source review. The residual risk is runtime only (Docker plus a two-node cluster on shared runners), which only a CI run on the rebased head can prove.
2.3 Documentation Updates
None needed for a test-only slice.
3. Architectural Soundness
- 3.1 Long-term solution: a real-system regression test with no synthetic reports or test-only production endpoints.
- 3.2 Maintainability: good; assertions are grouped into named helpers and the single-table, single-reader scope is explicit.
- 3.3 Extensibility: multi-table, heartbeat, recovery and PostgreSQL scenarios can reuse the fixture.
- 3.4 Historical-version compatibility: not applicable (test-only).
4. Issue Summary
| Number | Issue | Location | Severity |
|---|---|---|---|
| 1 | Stacked on unmerged #11512; diff is not yet the three-file slice | PR scope | High |
5. Merge Recommendation
Conclusion: Not recommended for merge
Blockers (must fix)
- Issue 1: wait for #11512 to merge, then rebase to the three owned files and mark the PR ready (it is currently a draft).
CI status of this head: the Build check on the apache side is still pending (https://github.com/apache/seatunnel/runs/121072808517) and only points at the fork's run, so there is no result yet. A green run on the rebased head is the one that will count. The branch is 8 commits behind dev and GitHub reports no conflicts; the next rebase onto dev after #11512 lands will cover that.
Recommended fixes (non-blocking): none.
Overall assessment: the validation test is careful and meaningful, and I have no code change to request in it. It is blocked only by sequencing. This review is by code reading only; nothing was executed locally. I will do a quick final pass as soon as #11512 lands and this branch is rebased.
|
Quick CI follow-up on Current CI state of this exact head: the apache What failed
Is it related to the diff? My read, as an inference from the logs and the diff (nothing was run locally): not caused by this PR's own content.
Minimal next step: no code change is needed for this CI result. Since this PR is a draft stacked on #11512, the CI that will count is the one on the rebased head after #11512 lands, so I would not spend a re-run on this head. If you want an earlier signal, "Re-run failed jobs" on the fork run (only Source conclusion: unchanged from my review. Nothing was executed locally for this follow-up; it is based on the check-run output and the fork's Actions logs. |
Purpose of this pull request
Part of STIP-30 (#11364), tracked by #11354. This is the draft Phase 2A validation slice and depends on #11512.
Adds a real MySQL snapshot/binlog-to-JDBC job on an embedded split master/worker cluster. The test checks naturally collected reader/enumerator reports, snapshot rows, incremental insert/update/delete results, native binlog progress, and cleanup after cancellation. It adds no production observation endpoint or synthetic reports.
Only three files belong to this follow-up. While #11512 is unmerged, GitHub's comparison against
devalso includes its foundation commits. Review the validation-only comparison. Do not merge this draft before the foundation lands and the diff is reconciled againstdev.Does this PR introduce any user-facing change?
No. This slice adds tests and test-scope dependencies on the existing CDC base and MySQL connector modules. No production dependencies, APIs, defaults or checkpoint behavior change.
The scenario covers one table and one reader. Source/sink queries verify the final DML batch independently; the progress assertion reaches at least one record from that batch, not every individual record. Checkpoint/restore fields remain explicitly unsupported. Multi-table, heartbeat, recovery and PostgreSQL coverage remain follow-ups.
How was this patch tested?
MysqlCdcProgressITand existingJobExecutionIT#testSayHello: 2 tests executed, 0 failures, 0 errors, 0 skipped per JVM.Reproduce from this branch with Java 8 or Java 11 and Docker:
./mvnw -B \ -pl seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base -am \ verify -DskipUT=true -DskipIT=false \ '-Dit.test=MysqlCdcProgressIT,JobExecutionIT#testSayHello' \ -Dfailsafe.failIfNoSpecifiedTests=false -DfailIfNoTests=false \ -Dskip.ui=true -Dlicense.skipAddThirdParty=trueLocal Docker runs needed the process-only compatibility option
'-Dsurefire.jvm.args=-Dfile.encoding=UTF-8 -Dapi.version=1.44'. No project dependency or global Docker configuration was changed.Check list