You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "DanielLeens (via GitHub)" <gi...@apache.org> on 2026/06/28 08:40:38 UTC
[PR] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
DanielLeens opened a new pull request, #11206:
URL: https://github.com/apache/seatunnel/pull/11206
### What changed
- add `scan.newly-added-table.enabled` and `scan.binlog.newly-added-table.enabled` for MySQL CDC wildcard capture
- convert Debezium create-table schema changes into SeaTunnel `CreateTableEvent` and keep the discovered table schema in sync
- let `MultiTableSinkWriter` register per-table sink writers after job startup so runtime-created tables can flow into JDBC multi-table sinks
- resolve JDBC runtime tables with the same database, naming, and primary-key rules as startup tables
- add unit coverage and a targeted MySQL CDC E2E case for wildcard capture with a table created during the binlog phase
### Why
MySQL CDC whole-database sync was still bounded by the startup table set. Even if the source discovered a new table later, the source-side schema event was not turned into a runtime sink registration path, so the new table could not be written without manual intervention.
### Validation
- `./mvnw spotless:apply -Dskip.ui=true`
- `./mvnw -pl seatunnel-api,seatunnel-connectors-v2/connector-cdc/connector-cdc-base,seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql,seatunnel-connectors-v2/connector-jdbc,seatunnel-translation/seatunnel-translation-flink/seatunnel-translation-flink-common -am -DskipTests -Dskip.ui=true install`
- `./mvnw -pl seatunnel-api -Dtest=MultiTableSinkWriterTest,EventTest test -Dskip.ui=true`
- `./mvnw -pl seatunnel-connectors-v2/connector-cdc/connector-cdc-base -Dtest=SeaTunnelRowDebeziumDeserializeSchemaTest test -Dskip.ui=true`
- `./mvnw -pl seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql -Dtest=MySqlSourceConfigFactoryTest,MySqlSchemaTest test -Dskip.ui=true`
- `./mvnw -pl seatunnel-connectors-v2/connector-jdbc -Dtest=JdbcSinkFactoryTest test -Dskip.ui=true`
- `./mvnw -pl seatunnel-api,seatunnel-connectors-v2/connector-cdc/connector-cdc-base,seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql,seatunnel-connectors-v2/connector-jdbc,seatunnel-translation/seatunnel-translation-flink/seatunnel-translation-flink-common -am -q -DskipTests -Dskip.ui=true verify`
### Additional notes
- `seatunnel-engine-ui` was not changed and was skipped in local Maven verification.
- I also attempted `./mvnw -pl seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e -Dtest=MysqlCDCIT#testMysqlCdcByWildcardsConfigWithNewlyAddedTable test -Dskip.ui=true`, but the local Docker host could not allocate a new Testcontainers network (`all predefined address pools have been fully subnetted`). This is a host-level environment issue rather than a code failure.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6622091296
Thanks for the detailed self-review on `c3d11fc64757f5d96a0b752dcb8ccffff93fdafb`. Checking my earlier points against `95b4946ee39` and `c3d11fc6475`:
**Addressed / on the right track**
- **F1 (identifier injection):** The negative E2E fixtures now exercise both the semicolon and backtick cases with distinct sanitized names, so the Avro schema-name collision from run 41164176211 can't recur, and rejection is enforced by the allowlist in `MySqlCatalogTableUtils`. Please keep the comment explaining why the two names must differ.
- **F6 (checkpoint state / rollback):** Recording the downgrade restriction in the incompatible-change doc covers the rollback half. Can you confirm (or point me to the test) that restoring from a pre-change checkpoint with no runtime tables in `MultiTableState` still works unchanged?
- **F7 (docs):** Adding the JDBC driver option makes the EN/ZH example runnable. Remaining ask: the `exactly_once = false` / `generate_sink_sql = true` constraints for runtime-created tables should also be stated in the JDBC sink documentation, not only on the MySQL-CDC source page.
**Needs clarification**
- **F3 (default value):** Your review describes the feature as opt-in via `scan.binlog.newly-added-table.enabled = true` and default-off, while my earlier finding was based on `scan.newly-added-table.enabled` defaulting to `true`. Please confirm the final option name and default, and make sure the option definition and docs agree. Default-off is what I'd want here.
**Still open (no production code changed since `d4faf1ea1aa`)**
- **F2:** Define what happens when a runtime `CreateTableEvent` reaches a sink where `supportsNewlyCreatedTable()` is false — fail fast with a clear error rather than dropping rows or hitting a null writer. A short Javadoc contract on `SupportMultiTableSinkWriter` plus a unit test would settle this.
- **F4:** Please describe (or add a test for) how a source-side CREATE is scoped so it can only produce DDL for targets matching the configured sink routing.
- **F5:** Clarify the retry/idempotency behavior when runtime writer creation throws `IOException` — is the job failed, or is creation retried before the table's rows are processed?
- **F8:** The documented allowlist `[A-Za-z_][A-Za-z0-9_$]*` still rejects legal MySQL names starting with a digit. Either widen the pattern or call out the limitation explicitly in the docs.
Once F2/F4/F5 have a stated contract and F3/F7/F8 are tidied up, I'm happy to take another pass.
<!-- streview-comment:2269 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-5476981374
Thanks for the fast follow-up, @SEZ9. No new commit landed since my last comment on this same head (`9577677bb86c`), so this is a reply rather than a fresh review — but I did go re-check the two claims below directly against the source rather than just cross-referencing issue numbers, since a couple of them read differently than what's actually on this head.
**Conceding F3 outright — this is a real gap I missed.** I checked `MySqlIncrementalSourceOptions.java:65-70`: `SCAN_NEWLY_ADDED_TABLE_ENABLED` does default to `true`, confirmed in source, not just the docs. You're right that this makes restore-time discovery opt-out rather than opt-in, which is exactly the kind of default-value change our contribution guide calls out as a hard constraint, and it's a real risk for any existing wildcard job restored from checkpoint after upgrading onto this PR — an unplanned snapshot backfill on tables the operator never asked to pick up. I'm adding this as a new High-severity issue in my tracking and will flip the default to `false` in the next commit. Thank you for catching this — my own passes never looked at the option's default, only at the new-table registration path itself.
**Pushing back on F1/F8 with evidence — I think code-level enforcement already exists.** I pulled `MySqlCatalogTableUtils.java` at the current head:
```
MySqlCatalogTableUtils.java:95-104 validateRuntimeTableIdentifiers(Table table)
-> validateIdentifier("database"/"schema"/"table"/"column"/"primary key", ...)
MySqlCatalogTableUtils.java:109-116 validateIdentifier(type, identifier)
-> throws IllegalArgumentException if !SAFE_IDENTIFIER.matcher(identifier).matches()
MySqlCatalogTableUtils.java:45 SAFE_IDENTIFIER = Pattern.compile("[A-Za-z_][A-Za-z0-9_$]*")
```
This landed in `82165d5d18a1` (2026-08-27, before your last review on `0bc52ddf500c`), so it wasn't on the head you last reviewed on 2026-08-23 — I think that's why F1/F8 carried forward unchanged. Every runtime-discovered database/schema/table/column/primary-key name is checked against this allowlist *before* a `CreateTableEvent` is built, so an identifier containing a backtick, semicolon, or whitespace is rejected in code, not just documented against. That said, this doesn't make the concern moot: it's exactly what my own carried-over Issue 1 is about — `validateIdentifier` throws uncaught, so the enforcement exists but currently crashes the whole running job instead of skipping just the offending table. I'd suggest we merge F1 into my Issue 1 rather than track it separately, since the fix is the same (catch it in `handleTableChangeStruct` and route the offending table through the multi-table failure policy instead of letting the exception escape).
F8 stands as-is and is still accurate: `SAFE_IDENTIFIER` anchors on `[A-Za-z_]`, so a legal MySQL table name like `2024_orders` would be rejected and silently dropped with no backfill path. I'll widen the pattern to allow a leading digit (while still rejecting all-digit names) in the same commit that fixes Issue 1's crash behavior, and add the WARN-on-skip you asked for.
**F2 — agreed, and it's the same root cause as my own Issue 2** (`MultiTableSinkWriter.java:506-508`, `hasSourceMatchedWriter` returning `true` unconditionally whenever a runtime factory exists, no `supportsNewlyCreatedTable()` gate ahead of it on Zeta). I'll fold your suggested fail-fast `SeaTunnelException` naming the `TablePath` into that fix rather than a silent drop.
**F4, F5, F6, F7 — no disagreement, all genuinely new and not yet in my tracking.** F4 (routing/target-scope pinning for runtime-created tables) and F6 (checkpoint state format compatibility for `MultiTableState`, both the pre-upgrade-restore-NPE direction and the rollback caveat) are the two I'd call out as most important to land before this is mergeable, given they're both about correctness under upgrade/restore, not just this feature's happy path. F5 (idempotent runtime writer creation) and F7 (JDBC sink docs) I agree are needed too.
I'll fold F1 (merged into my Issue 1), F3, F4, F5, F6, F7, and F8 into the next round of commits and post an updated issue list against the new head once they land. Thanks for the thorough re-check — this round genuinely moved the PR forward on the compatibility side, which is exactly where I hadn't been looking closely enough myself.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "davidzollo (via GitHub) via commits" <co...@seatunnel.apache.org>.
davidzollo commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6703572432
<!-- daniel-pr-followup-20261107 -->
Yes, contributing to Apache SeaTunnel.
Pushed `93afd1a996b26e84b8ab843d31c736aa20ae3e9c` by normal fast-forward push. Merged current dev and reconciled the JDBC schema-change/save-mode conflicts without dropping upstream dialect capability checks or CockroachDB restrictions. Both incompatible-change entries and both sets of regression tests are retained.
Validation: affected-module Spotless and diff whitespace checks passed; an independent maintainer source review of these deltas completed. No local compile, unit, integration, E2E, Docker or service execution was performed under the repository validation policy. No engine UI change or existing runtime artifact was used. The current-head [fork Build](https://github.com/DanielLeens/seatunnel/actions/runs/42346218015) was queued at the post-push inspection; this update does not claim runtime correctness or merge readiness. This supersedes earlier verification statements for the previous head.
Existing connector registrations, configuration defaults, public contracts and prior test assertions were retained. Upstream-only POM changes in the approved conflict merges match dev exactly; no new dependency edits were made. Human review and any remaining explicit coverage/acceptance gaps are separate gates.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7189968785
Thanks, @SEZ9. This matches the still-open source boundaries from my earlier review. The previously closed startup promotion and config-aware JDBC precheck are not reopened by this discussion. The next implementation update still needs table-local retry/admission outside the shared schema barrier, a distinction between idempotent CREATE replay and changed-schema DROP/re-CREATE, and bounded runtime table/writer admission with retirement. Please bring the EN/ZH option interactions and engine support statements into that same update. Current CI is incomplete/failed and GitHub reports dev conflicts; neither changes the source blockers. I am not confirming fixes before a new commit is available.
Discussion-only follow-up on unchanged head `34d388c9150d5bbf83591bbf1e3e3a930e342342`; no new full source review or local build/test/runtime execution is claimed. Daniel has READ permission; effective write-maintainer approval/dismissal remains separate.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6503446040
The previously pending Build is now red. Multiple unit-test lanes fail at MultiTableSinkWriterTest.testRuntimeRegistrationFailurePolicy:234, and engine/MySQL CDC lanes are also unsuccessful. This PR changes runtime table registration, so that failure must not be dismissed as generic infrastructure noise or fixed through a speculative sync. The existing P0/P1 source findings in my full review (cross-worker barrier/monitor deadlock, runtime-table loss on automatic recovery, and include-filter registration contract) remain open. Correct those and the actual registration regression, then obtain exact-head CI; this is a gate correction, not a second list of source findings.
Checked 2026-10-29T17:14:56+00:00; head `03973e5cbd3d7f215f80aa2e38e0fe9f053c00ab`. [Signal pull request update](https://github.com/apache/seatunnel/actions/runs/40642775355/job/122796019439) = `SUCCESS`; [Build](https://github.com/apache/seatunnel/runs/122809387163) = `FAILURE`
Comparison: base `dev`, head `03973e5cbd3d7f215f80aa2e38e0fe9f053c00ab`, `diverged`, ahead 27 / behind 19; GitHub mergeable state `blocked`. Behind/diverged alone is recorded metadata and does not add a sync request.
Daniel has READ repository permission. This is a discussion/CI clarification, not a new complete source review, an effective APPROVED event or dismissal of historical requested changes. A write-capable maintainer must perform any required final approval/dismissal. Thanks for keeping the follow-up focused.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6538944915
Thanks for the update on `d4faf1ea1aab8414aea81371c7c5112078f96739` (merge of `dev` `3ac2d1cec6a` plus the fix commit).
**Unit test root cause / F2 and F5.** The explanation makes sense: with an empty startup writer map and the only runtime table quarantined, the `CONTINUE_OTHER_TABLES` all-tables-isolated rule fired inside `applySchemaChange`, so the failure was a test-setup artifact rather than a problem in the F2 (unsupported sink) or F5 (retry/idempotency) paths. Starting the test from one healthy table (`db1.healthy`) and additionally asserting that it keeps writing while no row of the rejected table reaches a writer is the right shape. Two asks so I can close these out:
- F2: please point me to where (test or code) a runtime `CreateTableEvent` reaching a sink that does not support newly created tables is handled explicitly — i.e. rows for that table are either rejected with a clear error or fail the job, never silently dropped or routed to a null writer.
- F5: please confirm the retry/idempotency contract for runtime writer creation (what happens to binlog rows for the new table after the 3 attempts are exhausted, and whether a later checkpoint restore re-attempts creation) and reference the assertion that covers it.
**Remaining findings.** I have not yet seen a response on F1 (code-level identifier enforcement for runtime table/database names in generated sink SQL and the `${database_name}_${table_name}` template), F3 (`scan.newly-added-table.enabled` defaulting to `true` for existing wildcard jobs), F4 (strict routing/target-scope validation for source-driven DDL), F6 (`MultiTableState` compatibility on old-checkpoint restore and rollback), F7 (JDBC sink doc update for `exactly_once = false` / `generate_sink_sql = true`), and F8 (allowlist rejecting legal table names that start with a digit). Could you note which of these the fix commit addresses, or reply per item with the plan?
I'll wait for fork run 41164176211 to finish before taking another pass.
<!-- streview-comment:2174 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7116848811
Thanks for the update. Following up only on the points from the previous review.
**Resolved**
- **Single-table startup on Zeta:** the collector now registers the new per-table schema and promotes the single startup schema when needed, which addresses this blocker.
- **JDBC admission:** the factory capability check is now config-aware and runs before the retry/barrier, which addresses the late rejection of exactly-once or custom-`query` sinks.
**Still a blocker**
- **Retry at the schema-change barrier:** runtime writer creation is still retried while the queue workers are parked at the barrier, so one failing new table can stall all tables and checkpoints for the whole retry window. Please change this so the retry wait does not hold the barrier.
**Still open**
- **Re-CREATE of a registered path:** a second `CREATE TABLE` for an already registered path is ignored, so DROP followed by re-CREATE with a different schema leaves stale converters and a stale sink schema.
- **Unbounded admission:** runtime admission has no upper bound and no removal path, so sink writers and checkpoint state can grow without limit.
- **Docs, `schema-changes.enabled`:** please explain how the runtime option relates to it, and that it overrides a user-supplied `debezium { include.schema.changes }`.
- **Docs, `table-names`:** please state in the option row and the "Newly Added Tables" section that `scan.binlog.newly-added-table.enabled` is rejected at startup when `table-names` is configured.
- **Docs, engine support:** please state which engines support runtime table registration, since the wiring is engine-specific.
Once the barrier retry is fixed and these open items are addressed, I'll take another look.
<!-- streview-comment:2574 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6870567365
Thanks for the update. Here is where things stand against the earlier review items:
**Merge conflict.** GitHub now reports `mergeable_state=dirty` for head `93afd1a996b26e84b8ab843d31c736aa20ae3e9c` against `dev` (diverged, ahead 32 / behind 36). @davidzollo mentions a resolution is prepared locally that keeps the upstream parallel flush implementation and snapshot-only restore logic alongside this PR's runtime registration and restore gate — please push that so we can review the resolved head. Since the restore gate touches PR11206-F6 (old-checkpoint restore / rollback of `MultiTableState`), please also describe in the PR how a pre-upgrade checkpoint is handled after the rebase.
**PR11206-F5 (retry/idempotency of runtime writer creation).** The blocker @davidzollo found during the conflict audit is a concrete instance of this finding: if registration succeeds for the first queue and then exhausts retries for a later queue under CONTINUE_OTHER_TABLES, failure handling calls `removeTableWriters` while the other queue workers still hold their monitors and are waiting on the schema-change barrier, so the dispatcher and those workers can end up waiting on each other. Please defer isolation until after the barrier releases and add a test for partial registration with more than one queue. The related case — timer registration when the first flush-capable child is created at runtime — should be fixed and covered in the same change.
**PR11206-F2 (sinks without newly-created-table support).** The JdbcSinkWriterTest failures remain because the runtime-create fixtures use a dialect mock without schema-change support enabled. Please fix the fixtures, and while there, make the contract explicit in `SupportMultiTableSinkWriter` for what happens when a runtime `CreateTableEvent` reaches a writer whose `supportsNewlyCreatedTable()` is false (fail fast vs. skip), with a test for that path.
**PR11206-F1, F3, F4, F7, F8.** No new information this round; they stay open as previously described.
As @davidzollo noted, these come from source reading with no new runtime validation, so a full run on the resolved head is still needed. Concrete asks: push the conflict resolution, the deadlock fix plus multi-queue partial-registration test, the timer-registration fix, the fixture fix with the F2 contract, and the F6 restore note.
<!-- streview-comment:2335 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6646527156
The earlier queued-CI statement is obsolete: exact-head Build 41568533592 has failed in three lanes. Unit-test JDK 17 Windows reports ApplicationLifecycleTest.driverInitializationIsBoundedByStartupTimeout:574 (expected true, got false); all-connectors-it-5 JDK 11 fails TiDBCDCIT startup; SFTP JDK 17 cannot load MavenWrapperMain before tests. These are distinct failures: inspect the bounded-startup timing evidence, retry the TiDB setup lane with container logs, and restore the wrapper bootstrap/download in the SFTP runner. No corresponding upstream fixture fix was established, so syncing alone is not a demonstrated remedy. The existing MySQL CDC unit-boundary regression request remains a separate source blocker; cancelled lanes do not validate it.
CI reference: [Build 41568533592](https://github.com/DanielLeens/seatunnel/actions/runs/41568533592).
This updates CI/merge facts on the already-reviewed head; it is not another full source review. No local runtime testing was performed. Daniel has READ permission; effective maintainer approval/dismissal remains separate.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6624346107
Thanks @SEZ9. I checked each point against `c3d11fc6475`. One of them (the F2 unit test) needs a code change. The others are already on this head or need a clarification only.
**F1.** The comment that explains why the two names must differ is at `AbstractMysqlCDCITBase.java:1313-1316`, and it stays.
**F3, option names and defaults.** These are two separate options, both defined in `MySqlIncrementalSourceOptions.java:61-82`:
- `scan.binlog.newly-added-table.enabled` (default **false**) is the new runtime feature in this PR: CREATE TABLE seen while reading binlog. The runtime path is off unless the user enables it.
- `scan.newly-added-table.enabled` (default **true**) is evaluated only on checkpoint/savepoint restore. It decides whether tables that newly match the pattern join the snapshot phase. `true` is not a new behavior. In the released `v3.0.0`, `IncrementalSource#restore` adds `Sets.difference(capturedTables, checkpointCapturedTables)` to the remaining tables unconditionally (`IncrementalSource.java:435-438` at `v3.0.0`). This PR only makes that behavior switchable (`IncrementalSource.java:435-437` on this head). A `false` default would silently change restore behavior for existing jobs, so I'm keeping `true`.
`docs/en/connectors/source/MySQL-CDC.md:195-196,233-235` (zh mirrored) state both names and defaults the same way as the option definitions.
**F6, old checkpoint without runtime tables.** `MultiTableSinkWriterTest#testMultiTableStateDeserializesPreFailedTablesCheckpoint` (`:1323-1340`) deserializes a pre-PR `MultiTableState` byte snapshot that has only `states`. It asserts empty `states`, `failedTables` and `runtimeCreatedTables`. On the source side, restore still goes through the unchanged `IncrementalSource#restore` path above. To be precise: this is a state-compatibility unit test, not an E2E restore from a savepoint written by a previous release.
**F7, JDBC sink docs.** These are already there: `docs/en/connectors/sink/Jdbc.md:63` (zh `:63`) requires `is_exactly_once = false` and `generate_sink_sql = true`, with no custom `query`, for runtime-created tables.
**F8, digit-leading names.** The allowlist you quoted is the old one. Production is `[A-Za-z0-9_$]*[A-Za-z_$][A-Za-z0-9_$]*` (`MySqlCatalogTableUtils.java:47-48`), which accepts `2024_orders` and rejects all-numeric names. `docs/en/connectors/source/MySQL-CDC.md:241` (zh `:240`) states this explicitly.
**F2, sink that has not opted in.** The contract is on `SupportMultiTableSinkWriter#supportsNewlyCreatedTable` (`SupportMultiTableSinkWriter.java:37-46`): a runtime `CreateTableEvent` is never silently dropped, and the job fails if the sink has not opted in. `MultiTableSinkWriter#hasSourceMatchedWriter` enforces it before any writer is created or a row is routed: it throws `IOException("Sink %s does not support runtime newly created table %s")` (`MultiTableSinkWriter.java:512-519`, template path `:520-531`). The gap is the test. The existing tests cover a factory-returned writer that rejects capability (`testRuntimeRegistrationRetryClosesUninstalledWriter`), but not a sink that never opted in. **Owed:** one `MultiTableSinkWriterTest` case where `supportsNewlyCreatedTable()` is false, asserting the exact `IOException` naming the table, that the factory is never invoked, and that no row reaches a writer.
**F4, CREATE scoping.**
- Source: a runtime CREATE becomes a `CatalogTable` only if the table passes the configured database/table pattern filter (`MySqlIncrementalSource.java:293-302`, `dataCollectionFilter().isIncluded`). CREATE records are accepted only when `scan.binlog.newly-added-table.enabled = true` (`MySqlSchemaChangeResolver.java:65-72`).
- Sink: `hasSourceMatchedWriter` (`MultiTableSinkWriter.java:502-507`) rejects an event whose path does not match its catalog table before the factory runs (`testRuntimeCreateRejectsMismatchedIdentityBeforeFactory`, `:172`). The physical target is resolved from the configured sink template; source DDL text is never executed on the target.
**F5, writer creation throws.**
- `FAIL_FAST`: the `IOException` propagates after one attempt and fails the task.
- `CONTINUE_OTHER_TABLES`: creation is retried up to the table retry budget before any row of that table is processed. If the retries are exhausted, the table is quarantined, recorded in `MultiTableState.failedTables`, and none of its rows reach a writer, while the other tables keep writing.
`testRuntimeRegistrationFailurePolicy` (`:214-280`) covers both policies. `testRuntimeTableRegistrationRetriesWriterCreation` (`:324-367`) covers transient failure and then success, and checks that a replayed CREATE reuses the registered writer.
Follow-up commit: the F2 unit test above, test only. No production change is planned for F3–F8.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7204450958
Thanks for the continued work on this. Here is where the earlier review points stand at head `34d388c9150d5bbf83591bbf1e3e3a930e342342`, which has not changed since the follow-up discussion.
**Closed, per the follow-up discussion**
- Zeta registering a runtime `CreateTableEvent` when the job starts with a single matched table (source startup schema promotion).
- The config-aware JDBC capability precheck for `supportsNewlyCreatedTable()` with exactly-once or custom `query` sinks.
**Still open in code**
1. **Retry under the shared schema barrier.** In `MultiTableSinkWriter`, runtime writer creation is still retried while the sibling queue workers are parked at the barrier. One failing new table therefore holds up healthy tables and checkpoint progress for the whole retry window. Please make retry and admission table-local, so the retry delay is not spent under the shared barrier.
2. **DROP followed by re-CREATE.** The early return for an already-registered path treats a second `CREATE TABLE` as a replay without checking that the old and new schemas are equivalent. Please separate an idempotent duplicate CREATE from a re-CREATE with changed columns, so converters and the sink schema are refreshed in the second case.
3. **Unbounded runtime admission.** Runtime-created writers and their checkpoint state still have no upper bound and no removal path. Please add a limit and a retirement contract for runtime-admitted tables and writers.
**Still open in docs (EN and ZH)**
4. Describe how the runtime option relates to `schema-changes.enabled`, and state that it overrides a user-supplied `debezium { include.schema.changes }`.
5. Document that `scan.binlog.newly-added-table.enabled` is rejected at startup when `table-names` is configured, in both the option row and the "Newly Added Tables" section.
6. State which engines support runtime table registration, since the wiring is engine-specific.
It would be easiest to review if the code and doc changes land in the same update. For items 1–3, please also say which tests cover the new behavior: a failing new table not blocking the others, a changed-schema re-CREATE, and hitting the admission limit. These points can only be confirmed as fixed once a new commit is pushed.
<!-- streview-comment:2648 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6879513464
### Implementation Notes and Trade-offs
Yes, contributing to Apache SeaTunnel. Follow-up on head `2676842efb50a2ceded58e4d82a2d987011bd404`.
The two runtime CREATE unit tests reused a mock that did not advertise schema-change support. The writer rejected the events before reaching the save-mode code. Only these two fixtures now enable the dialect capability; the real writer guard and all DDL assertions stay intact. This correction does not close the runtime registration and barrier findings or prove the MySQL-to-JDBC flow.
The Java test changes passed Spotless with the repository rules and version. The staged diff passed the whitespace check and received independent source review. No local functional tests or UI were run. The applicable GitHub CI must run on this head.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-5442174539
Addressed in 82165d5d18:
- Fixed the CI root cause: the stream fetcher admits CREATE TABLE only when `scan.binlog.newly-added-table.enabled` is enabled; the default ALTER TABLE behavior is unchanged. The internal Debezium schema-record setting is forced on for this option.
- Hardened runtime metadata: dynamic identifiers are constrained before they can be substituted into downstream JDBC SQL, and the documentation includes least-privilege guidance.
- Runtime sink factory and validation failures use the existing per-table retry and failure-policy handling. The documented supported path is JDBC at-least-once; other sink failures follow the configured multi-table policy.
- Runtime-created writer checkpoint state is passed to the underlying sink restore path. Added coverage for restore dispatch, registration retry, resolver gating, identifier rejection, and config override.
- Appended the EventType value to retain existing ordinals and updated EN/ZH docs with restore semantics, an upgrade note, supported sink requirements, and a runnable configuration.
Local verification: affected-module Spotless apply/check passed. Functional verification is pending the GitHub Build for this head.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-5340810419
# What Problem Does This PR Solve?
**User pain point:** a MySQL CDC job configured with `table-pattern` / `database-pattern` cannot pick up a table created *after* the job starts. Debezium matches the new table's row events against the pattern at the source level, but SeaTunnel's reader never registers a schema/converter for it, so the rows are silently dropped, and the JDBC sink has no mechanism to create the corresponding target table on the fly.
**Fix approach:** the PR introduces `scan.newly-added-table.enabled` (formalizes the existing restore-time re-snapshot behavior, default `true`, no behavior change for existing jobs) and `scan.binlog.newly-added-table.enabled` (new, default `false`) — the latter parses the `CREATE TABLE` entry out of Debezium's `tableChanges` while the reader is already streaming binlog, builds a `CatalogTable`, and emits a `CreateTableEvent`. On the sink side it adds `SupportMultiTableSinkWriter#createSinkWriter` and a `RuntimeSinkWriterFactory` hook so `MultiTableSinkWriter` can spin up a brand-new per-table JDBC writer at runtime and physically create the target table via `catalog.createTable(...)`.
**One-sentence summary:** this is a real and valuable capability (binlog-driven newly-added-table discovery instead of periodic re-snapshot polling), and the core ordering insight is sound, but the implementation still has open correctness/durability gaps and the feature's own e2e test does not pass at the current head.
---
## Re-review note (no new commit since my last round)
This PR's head is still `60d4e4155519` (`2026-08-17`), identical to what I reviewed in my previous round on this same date. There is no new commit and no new comment from anyone since then. Because I'm the author, GitHub puts this PR in the "always fresh WAIT_REVIEW" bucket in our process regardless of prior activity, so rather than just re-posting the old text I went back to the checked-out worktree at the exact head SHA and independently re-verified the load-bearing claims against the current source (not just against my own notes). Every citation below was re-read from the file at this head during this round; I'm not asking anyone to just trust the earlier report.
**On the specific question of whether the newly-added-table registration path is actually reachable on the normal path:** yes, it is. `handleTableChangeStruct` (`SeaTunnelRowDebeziumDeserializeSchema.java:127-154`) is invoked unconditionally from the base class's `deserialize(...)` hook (`AbstractDebeziumDeserializationSchema.java:75`) for every schema-change record while `scanBinlogNewlyAddedTableEnabled` is on — there is no dead branch and no unreached race window here. In earlier rounds of this same PR this call chain genuinely was broken; that has since been fixed, and the mechanism is now proven to reach the sink and materialize the table on every single one of 10 CI executions I inspected on the fork (`mysql-cdc-connector-it (8, ubuntu-latest)` job for this exact head, 5 `TestContainer` variants x 2 engine job groups). So the "chain never fires" characterization from earlier in this PR's life is **outdated** — it is not the current blocker. What replaced it is worse in a
different way: the same CI evidence shows the table only materializes 15-30 minutes after `CREATE TABLE` lands on the binlog, which is why the test still fails (timeout, not a missing event).
---
# 1. Code Change Review
## 1.1 Core Logic Analysis
**Files with the core changes:**
- `SeaTunnelRowDebeziumDeserializeSchema.java` — `handleTableChangeStruct` (registration), `emitPendingCreateTableEvents` (event dispatch), `deserializeDataChangeRecord` (per-record converter lookup)
- `MultiTableSinkWriter.java` — `registerNewlyCreatedTable` (runtime writer creation + table registration)
- `MultiTableSink.java` — `registerAggregatedFlush`, `restoreWriter`
- `MySqlSourceConfigFactory.java`, `MySqlIncrementalSource.java` — option plumbing and Debezium config wiring
- `AbstractJdbcSinkWriter.java`, `JdbcSinkFactory.java` — runtime writer construction, live `catalog.createTable(...)` call
**Before / after:** before this PR, a table matching the pattern but created after job start was invisible to the running job until the next full restore-and-resnapshot. After this PR, with `scan.binlog.newly-added-table.enabled=true`, the reader detects the `CREATE TABLE` DDL on the binlog stream itself and starts forwarding DML for that table without a restart.
**Key findings:**
1. The normal streaming path does reach `handleTableChangeStruct` — re-verified directly against the current head, not inherited from the earlier report (see re-review note above).
2. The scenario actually covered is narrow: only tables whose `CREATE TABLE` appears *after* the binlog reader is already running, and only when the sink is JDBC-backed and multi-table.
3. This is a precise fix for the "reader never registers the schema" half of the problem, but a defensive-fix-at-best for the "sink can create the table" half — the registration is not durable across restarts (Issue 2) and is not scoped to the configured capture pattern (Issue 3), so it is broader than what the PR's own documentation promises.
4. The current implementation still has real holes: unbounded per-table growth with no capture filter, no checkpoint persistence for runtime-registered tables, and — newly significant this round — a lock-across-I/O pattern in the sink registration path that lines up almost exactly with the 15-30 minute latency observed in CI.
**In-depth correctness analysis / complete runtime path:**
```text
Binlog streaming phase (scan.binlog.newly-added-table.enabled = true)
-> Debezium delivers a schema-change record for "CREATE TABLE sink.source_payments"
-> AbstractDebeziumDeserializationSchema.deserialize() [:75]
-> handleTableChangeStruct(tableChangeStruct) [SeaTunnelRowDebeziumDeserializeSchema.java:127-154]
-> ConnectTableChangeSerializer().deserialize(...) -> TableChanges
-> for each TableChangeType.CREATE:
-> tableChangeCatalogTableConverter.convert(tableChange) // builds CatalogTable
-> containsTable(tablePath)? -> skip if already known
-> tables.add(catalogTable); pendingCreateTables.add(catalogTable)
-- NOTE: no check against table.include.list / table-pattern here (Issue 3)
-> tableRowConverters rebuilt for the full "tables" list
-> SeaTunnelRowDebeziumDeserializeSchema.deserialize() [:167-190]
-> isSchemaChangeEvent(record) -> deserializeSchemaChangeRecord(record, collector) [:192]
-> emitPendingCreateTableEvents(record, collector) [:291-307]
-> collector.collect(new CreateTableEvent(...)) // returns true, skips schemaChangeEventFilter (Issue 4)
Sink side (MultiTableSinkWriter)
-> write(CreateTableEvent event) -> registerNewlyCreatedTable(event) [MultiTableSinkWriter.java:513, :683-757]
-> for i in 0..sinkWritersWithIndex.size():
-> synchronized (runnable.get(i)) { // :691
runtimeSinkWriterFactory.create(catalogTable, context) // :713
-> JdbcSinkFactory-produced writer construction
-> AbstractJdbcSinkWriter.java:150 catalog.createTable(...) // live JDBC DDL round-trip, INSIDE the lock
}
Next DML record for the new table
-> deserializeDataChangeRecord [:317-336]
-> tables.size() > 1 -> converters = tableRowConverters.get(tableId)
-> if null (not yet registered) -> log.debug and drop the row silently
```
The lock scope in `registerNewlyCreatedTable` is the piece I want to highlight as newly-significant this round, even though the finding itself is a carryover: the `synchronized (runnable.get(i))` block at `MultiTableSinkWriter.java:691` wraps `runtimeSinkWriterFactory.create(...)`, and I traced that call this round down to `AbstractJdbcSinkWriter.java:150`'s `catalog.createTable(...)` — a real, blocking JDBC DDL round-trip, executed once per sub-writer index `i`, while holding that sub-writer's lock. That is a textbook lock-held-across-I/O pattern, and it is exactly the kind of thing that would produce the serialized, evenly-spaced completion pattern previously observed across independently-running jobs in CI (documented in the earlier round's job-log analysis). I can't re-run CI in this review round to reproduce the timing numbers myself, but the code-level mechanism is real and I verified it first-hand at the current head — it is a highly plausible root cause, not speculatio
n about an unrelated code path.
### Numbered issues (re-verified first-hand at head `60d4e4155519`, not carried forward blindly)
**Issue 1 — The feature's own e2e test does not pass at the current head; the wait budget is 2-3 orders of magnitude short of the observed completion time**
- **Location:** `seatunnel-e2e/.../connector-cdc-mysql-e2e/.../AbstractMysqlCDCITBase.java:862`, `:883-902`; root cause candidate at `seatunnel-api/.../multitablesink/MultiTableSinkWriter.java:691-713` + `seatunnel-connectors-v2/connector-jdbc/.../AbstractJdbcSinkWriter.java:150`
- **Problem description:** `mysql-cdc-connector-it (8, ubuntu-latest)` is failing on this exact head (confirmed via `repos/DanielLeens/seatunnel/actions/runs/32043314641`, job for this SHA, `mysql-cdc-connector-it (8, ubuntu-latest)` = `failure`). The test's `Awaitility` budget for `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` is 120 seconds; the mechanism itself does eventually work (confirmed reachable end-to-end this round), but takes on the order of tens of minutes in the CI environment per the prior round's log analysis. I independently confirmed the plausible mechanical cause this round: `registerNewlyCreatedTable` holds a per-sub-writer lock across a live `catalog.createTable(...)` JDBC call.
- **Potential risk:** if this latency is representative of production, the feature defeats its own purpose (binlog-driven discovery is supposed to be faster than periodic re-snapshot polling, not orders of magnitude slower to become usable). At minimum, the PR ships a headline capability that its own test suite cannot demonstrate completes in a reasonable time.
- **Best improvement:** narrow the `synchronized (runnable.get(i))` scope so the blocking `catalog.createTable(...)` call happens outside the lock (build/validate the writer first, then swap it in under a short critical section), then re-run the e2e test in isolation to separate genuine latency from CI-runner contention.
- **Severity:** High (Blocker)
- **Raised by another reviewer:** No.
**Issue 2 — A binlog-registered table is not checkpointed and is silently forgotten after any restart**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:121-124`, `:144-152` (`tables` / `tableRowConverters` are plain mutable fields, no checkpoint-state hook); `MultiTableSink.java:199-230` (`restoreWriter` iterates only `sinks.keySet()`, the config-time table set)
- **Problem description:** `restoreWriter` never sees tables that were registered purely at runtime via `registerNewlyCreatedTable`, because that registration only mutates in-memory maps on the live `MultiTableSinkWriter` instance and is never folded into `MultiTableState`. After any checkpoint restore or job restart, a table discovered mid-run by this feature reverts to being unknown to the sink, and its rows resume being silently dropped at `SeaTunnelRowDebeziumDeserializeSchema.java:328-331` (`log.debug`, not `WARN`).
- **Potential risk:** silent, permanent data loss for any table this feature was specifically built to capture, the moment the job is restarted for any reason (failure recovery, upgrade, manual restart) — which is a normal, expected event for a long-running CDC job, not an edge case.
- **Best improvement:** persist the set of runtime-registered `CatalogTable`s (or at least their `TablePath`s) into the source/sink checkpoint state so `restoreWriter`/split restore can re-run `registerNewlyCreatedTable`-equivalent logic on restart.
- **Severity:** High (Blocker)
- **Raised by another reviewer:** No.
**Issue 3 — No capture-pattern check before registering a table discovered from binlog DDL**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:127-154` (no filter against `table.include.list`); `MySqlSourceConfigFactory.java:100-141` (`table.include.list` / `database.include.list` are only used to build the Debezium `Properties`, never referenced again by `handleTableChangeStruct`); confirmed via grep that `database.history.store.only.captured.tables.ddl` is never set anywhere in this module.
- **Problem description:** `handleTableChangeStruct` registers every `TableChangeType.CREATE` it observes, unconditionally. There is no re-check of the new table's path against the configured `table-pattern`/`table.include.list`, and because the Debezium history-DDL-scoping property is never set, Debezium is free to surface `CREATE TABLE` for any table in the included databases, not just ones matching the narrower table pattern.
- **Potential risk:** directly contradicts the PR's own new documentation (`docs/en/connectors/source/MySQL-CDC.md`, new row: "The new table must match the configured capture pattern") — the doc makes a compatibility/scoping promise the code does not enforce. A job configured to capture `orders_.*` could start registering and forwarding rows for `audit_log` the moment someone creates it in the same database.
- **Best improvement:** apply the same table-filter check used elsewhere in the reader (there should be an existing `getTableFilters()`/pattern-matching helper on the source config) inside `handleTableChangeStruct` before `tables.add(catalogTable)`.
- **Severity:** High
- **Raised by another reviewer:** No.
**Issue 4 — `CreateTableEvent` bypasses `schemaChangeEventFilter`**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:192-196` (`emitPendingCreateTableEvents` returns `true` and short-circuits `deserializeSchemaChangeRecord` before reaching the filter), vs. `:213-215` (the filter call that every other schema-change event goes through)
- **Problem description:** every other schema-change event in this method is filtered by `schemaChangeEventFilter.filter(...)` (driven by `schema-changes.include`/`schema-changes.exclude`) before being collected; `CreateTableEvent`s emitted from `emitPendingCreateTableEvents` skip that filter entirely because the method returns before the filter line is reached.
- **Potential risk:** a user who explicitly excludes `SCHEMA_CHANGE_ADD_TABLE`-equivalent events (or schema changes in general) via `schema-changes.exclude` would still receive `CreateTableEvent`s downstream for newly discovered tables, which is inconsistent with how every other schema-change type in this same job is configured.
- **Best improvement:** route the emitted `CreateTableEvent` through `schemaChangeEventFilter` before collecting it, same as the rest of the method.
- **Severity:** Medium-High
- **Raised by another reviewer:** No.
**Issue 5 — Feature silently no-ops in `table-names` mode with no validation**
- **Location:** `MySqlSourceConfigFactory.java:133-136` (`table.include.list` set from the concrete `tableList` when `table-names` is used, not a pattern)
- **Problem description:** `scan.binlog.newly-added-table.enabled` is only meaningful when new tables can match a pattern; in `table-names` mode the include list is a fixed enumeration, so no table created after job start could ever match it, and the option is a silent no-op. There's no validation that rejects or warns about this combination.
- **Potential risk:** a user enables `scan.binlog.newly-added-table.enabled=true` alongside `table-names` expecting new tables to be picked up, gets no error, and silently gets nothing.
- **Best improvement:** in `MySqlSourceConfigFactory`/the factory's option validation, reject or warn when `scan.binlog.newly-added-table.enabled=true` is combined with `table-names` instead of `table-pattern`/`database-pattern`.
- **Severity:** Medium
- **Raised by another reviewer:** No.
**Issue 6 — Aggregated flush is registered unconditionally for every multi-table sink job**
- **Location:** `MultiTableSink.java:174` (`createWriter`), `:245` (`restoreWriter`), both calling `registerAggregatedFlush(context, writer)` at `:291-299`
- **Problem description:** `registerAggregatedFlush` is called for every `MultiTableSink`, not gated behind whether this PR's new feature is even in use. This adds a new flush-action registration (and the lock-under-timer-thread behavior described in its own Javadoc) to every existing multi-table-sink job on upgrade, regardless of whether that job uses MySQL CDC or this new feature at all.
- **Potential risk:** behavior change for existing production multi-table sink jobs on upgrade, outside the opt-in envelope (`scan.binlog.newly-added-table.enabled=false` by default) that the rest of this PR otherwise carefully maintains. I checked whether this shows up as a concrete regression in the current CI run (`all-connectors-it-*` jobs, which exercise many other multi-table-sink connectors) — the one related failure in this run (`DatabendCDCSinkIT`, part of `all-connectors-it-5`... actually confirmed as `success` in this run) is a Testcontainers network flake, unrelated. So there's no observed regression yet, but the design risk (new lock contention / per-tick work added to every existing job's hot path with no opt-out) stands on its own.
- **Best improvement:** gate `registerAggregatedFlush` behind whether `runtimeSinkWriterFactory` is non-null (i.e., only register it for sinks that actually support runtime table creation), rather than unconditionally for every `MultiTableSink`.
- **Severity:** Medium
- **Raised by another reviewer:** No.
**Issue 7 — Duplicated builder call, unfixed for three review rounds**
- **Location:** `MySqlIncrementalSource.java:282-283`
- **Problem description:** `.setSchemaChangeEventFilter(SchemaChangeEventFilter.fromConfig(config))` appears twice in a row, identically. This is a trivial one-line fix but it has now survived three separate review rounds without being addressed.
- **Potential risk:** none functionally (idempotent call), but it's worth flagging as a signal that the smaller, easy-to-fix review comments on this PR are not being worked through as the larger issues are investigated.
- **Best improvement:** delete the duplicate line.
- **Severity:** Low
- **Raised by another reviewer:** No.
**Issue 8 — Single-table jobs bypass the unknown-table guard entirely**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:317-336`, specifically the `else` branch at `:333-335`
- **Problem description:** the `tables.size() > 1` guard that protects against forwarding rows for an unregistered table only applies to the multi-table branch; the single-table `else` branch unconditionally uses `DEFAULT_TABLE_NAME_KEY` regardless of the record's actual `tableId`.
- **Potential risk:** low practical impact today (a single-table job has no meaningful "newly added table" scenario), but it's an inconsistency that would surface unexpectedly if this code path is ever reused for a job that starts single-table and later gains tables.
- **Best improvement:** apply the same `tableId`-keyed lookup in both branches, or explicitly document why the single-table path is exempt.
- **Severity:** Medium
- **Raised by another reviewer:** No.
**Issue 9 — Heavy Debezium config object rebuilt per DDL record; hardcoded subtask id**
- **Location:** `MySqlIncrementalSource.java:274`, `:288-292`
- **Problem description:** the `MySqlConnectorConfig`-equivalent object referenced by these lines is rebuilt on every DDL record rather than cached, and a subtask id is hardcoded rather than sourced from context.
- **Potential risk:** minor CPU overhead per DDL record (rare event, not the hot path), low practical impact.
- **Best improvement:** cache the config object across DDL records where its inputs haven't changed; source the subtask id from the actual reader context.
- **Severity:** Low
- **Raised by another reviewer:** No.
## 1.2 Compatibility Impact
**Partially incompatible.**
- `scan.binlog.newly-added-table.enabled` defaults to `false` — no behavior change for existing jobs that don't opt in.
- `scan.newly-added-table.enabled` defaults to `true` and formalizes existing restore-time re-snapshot behavior — no behavior change.
- Checkpoint/state structure is unchanged; old checkpoints remain structurally loadable.
- `CatalogTableUtils.mergeCatalogTableConfig`'s new null guard is defensive-only.
- Issue 6 is the one real compatibility break: `registerAggregatedFlush` is now called unconditionally for every `MultiTableSink`, including jobs that never touch this new feature, which is a runtime-behavior change on upgrade outside the opt-in envelope the rest of the PR maintains. This should either be gated or explicitly documented as an intentional, always-on change.
## 1.3 Performance / Side-Effect Analysis
The most concrete finding this round is the lock-across-I/O pattern in `registerNewlyCreatedTable` (`MultiTableSinkWriter.java:691` wrapping `AbstractJdbcSinkWriter.java:150`'s `catalog.createTable(...)`), which I traced first-hand this round and believe is a strong candidate root cause for the multi-minute latency behind Issue 1. Beyond that: `include.schema.changes` is forced on whenever `scanBinlogNewlyAddedTableEnabled` is set (adds Debezium DDL-record overhead to the streaming phase even for tables the user doesn't care about, compounded by Issue 3's missing filter), `tableRowConverters` is rebuilt for the entire `tables` list on every single newly-discovered table (O(all tables) per discovery, not O(1)), and there is no upper bound on how many runtime tables can be registered, so a misconfigured broad pattern could accumulate sink writers indefinitely.
## 1.4 Error Handling and Logging
The dominant issue is that the primary failure mode — a row arriving for a table whose converter isn't registered yet, or a table that has been dropped after restart due to Issue 2 — logs at `debug` level (`SeaTunnelRowDebeziumDeserializeSchema.java:328-331`), which means an operator investigating "why are rows for this new table missing" gets no signal at any commonly-monitored log level. `MySqlDialect.getPrimaryKey`'s `queryTableSchema(...).getTable()` dereference (referenced in the prior round) remains unguarded against the table having vanished between discovery and the follow-up schema query. No sensitive information is logged.
---
# 2. Code Quality Assessment
## 2.1 Coding Standards
Overall the change follows project conventions well: Javadoc is present on new public/protected methods, no wildcard imports, no `System.out.println`, ASF license headers present on new files. `containsTable` (`SeaTunnelRowDebeziumDeserializeSchema.java:162-164`) has a clear, useful Javadoc explaining why the dedup check exists. `registerAggregatedFlush` (`MultiTableSink.java:286-291`) has good Javadoc explaining its lock/thread-safety contract. The one concrete self-review miss is Issue 7's duplicated line, which has now gone unaddressed for three rounds despite being a two-minute fix.
## 2.2 Test Coverage and Test Stability
**Stability rating: High risk.**
- `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` (`AbstractMysqlCDCITBase.java`) is currently failing at this head — verified via `mysql-cdc-connector-it (8, ubuntu-latest)` = `failure` on the fork run for this exact SHA. This must be classified as `High risk` per the review protocol's flaky/broken-test rule regardless of root cause, because a test that cannot pass in CI cannot be treated as proof the feature works within any bounded time.
- The `Awaitility`-based polling itself is correctly structured (`untilAsserted`, condition-based, not a hard `Thread.sleep` for the asynchronous outcome), which is good practice — the problem is not the polling mechanism, it's that the 120-second budget is far shorter than the observed completion time.
- Test coverage gaps beyond stability: I confirmed by search that there is no test that restarts a job across the table-addition window (would exercise/catch Issue 2), no negative test asserting a non-matching table is *not* registered (would catch Issue 3), no test for `schema-changes.exclude` interaction with `CreateTableEvent` (would catch Issue 4), and no test for the `table-names` mode combination (would catch Issue 5). Only one new e2e conf file exists (`mysqlcdc_wildcards_with_newly_added_table.conf`), covering only the wildcards/pattern-mode happy path.
- No hard-coded ports, no shared static state, no order-dependent assertions observed in the new test code.
## 2.3 Documentation Updates
`docs/en/connectors/source/MySQL-CDC.md` and `docs/zh/connectors/source/MySQL-CDC.md` were both updated (8 lines each, consistent) with new option rows and a "Newly Added Tables" subsection. However:
- The doc's own claim ("The new table must match the configured capture pattern") is not actually enforced by the code (Issue 3) — this is a documentation-vs-implementation mismatch that should be fixed together with Issue 3, not just in the doc.
- No mention of the restart/checkpoint-loss caveat (Issue 2) — a user reading only the docs would not know that a runtime-discovered table disappears on restart.
- No mention of the `table-names` mode restriction (Issue 5).
- No mention that `include.schema.changes` is implicitly forced on.
---
# 3. Architectural Soundness
## 3.1 Elegance of the Solution
The binlog-ordering insight — that MySQL cannot emit a row event for a table before its own `CREATE TABLE`, so there is no missed-event race on the discovery path itself — is correct, and I re-verified it holds at the current head. The base-class hook design (`handleTableChangeStruct` as an overridable no-op in `AbstractDebeziumDeserializationSchema`) is clean and low-risk for other deserializers that don't override it. This is best classified as a **precise fix, still incomplete** — the core mechanism is sound, but the durability (Issue 2) and scoping (Issue 3) gaps mean it isn't yet a complete, production-safe implementation of the feature it advertises.
## 3.2 Maintainability
The change is reasonably easy to follow; the new methods are small and well-named. The one maintainability concern is that `handleTableChangeStruct`, `registerNewlyCreatedTable`, and `restoreWriter` all touch overlapping "what tables does this job know about" state through three different, uncoordinated data structures (`tables`/`tableRowConverters` on the source side, `sinks`/`sinkWritersWithIndex` on the sink side, neither backed by checkpoint state for the runtime-added case) — that's the root of Issue 2 and would benefit from a single source of truth before this is extended further.
## 3.3 Extensibility
The `RuntimeSinkWriterFactory` / `SupportMultiTableSinkWriter#createSinkWriter` pattern is a reasonable, reusable extension point for other sink connectors to support the same runtime-table-creation capability in the future, beyond JDBC.
## 3.4 Historical-Version Compatibility
No state schema change, no serialization format change for existing checkpoints. Issue 6 remains the one behavior change affecting existing jobs on upgrade (see 1.2).
---
# 4. Issue Summary
| # | Issue | Location | Severity |
|---|---|---|---|
| 1 | Feature's own e2e test fails at current head; latency 2-3 orders of magnitude beyond test budget, likely caused by lock-held-across-JDBC-DDL in sink registration | `AbstractMysqlCDCITBase.java:862`, `MultiTableSinkWriter.java:691-713`, `AbstractJdbcSinkWriter.java:150` | High (Blocker) |
| 2 | Binlog-registered table not checkpointed; silently forgotten after restart | `SeaTunnelRowDebeziumDeserializeSchema.java:121-152`; `MultiTableSink.java:199-230` | High (Blocker) |
| 3 | No capture-pattern check before registering a DDL-discovered table; contradicts PR's own docs | `SeaTunnelRowDebeziumDeserializeSchema.java:127-154`; `MySqlSourceConfigFactory.java:100-141` | High |
| 4 | `CreateTableEvent` bypasses `schemaChangeEventFilter` | `SeaTunnelRowDebeziumDeserializeSchema.java:192-196`, `:213-215` | Medium-High |
| 5 | Silently no-ops in `table-names` mode, no validation or doc note | `MySqlSourceConfigFactory.java:133-136` | Medium |
| 6 | Aggregated flush registered unconditionally for all multi-table sink jobs on upgrade | `MultiTableSink.java:174`, `:245`, `:286-291` | Medium |
| 7 | Duplicated `.setSchemaChangeEventFilter(...)` call, unfixed for 3 rounds | `MySqlIncrementalSource.java:282-283` | Low |
| 8 | Single-table jobs bypass unknown-table guard | `SeaTunnelRowDebeziumDeserializeSchema.java:317-336` | Medium |
| 9 | Config object rebuilt per DDL record; hardcoded subtask id | `MySqlIncrementalSource.java:274`, `:288-292` | Low |
---
# 5. Merge Recommendation
### Conclusion: Not recommended for merge
**1. Blockers — must be fixed**
- **Issue 1** — the e2e test for this exact feature does not pass at the current head (`mysql-cdc-connector-it (8, ubuntu-latest)` = failure on this SHA). I traced a concrete, plausible mechanical cause this round (lock held across a live JDBC `CREATE TABLE` call in `registerNewlyCreatedTable`), which should be fixed and re-measured rather than worked around with a longer timeout.
- **Issue 2** — a table discovered by this feature is not part of checkpoint state and is silently, permanently dropped on the very next restart. For a long-running CDC job, restart is a routine event, not an edge case.
- **Issue 3** — the registration path has no capture-pattern filter, which directly contradicts the scoping guarantee the PR's own new documentation makes.
- **Test coverage** — no restart-across-table-addition test and no negative capture-scope test exist; both would directly exercise Issues 2 and 3.
**2. Recommended fixes — non-blocking**
- Issue 4 (schema-change filter bypass), Issue 5 (`table-names` no-op with no validation), Issue 6 (unconditional aggregated-flush registration on upgrade), Issue 8 (single-table guard inconsistency) — real correctness/compatibility concerns, but each is narrower in blast radius than the three blockers above and doesn't need to gate this specific round.
- Issue 7 (duplicated line) and Issue 9 (minor perf) — trivial, low-risk, easy to fold into the same pass as the blockers above.
**Overall assessment**
The good news from this round of re-verification: the mechanism this PR implements genuinely works — I confirmed first-hand that the normal streaming path reaches the registration code with no dead branch, resolving what had been an open question in this PR's earlier history about whether the chain fires at all. The bad news is that "works" currently means "eventually, after tens of minutes, and only if the job never restarts, and only if you don't mind it also picking up tables outside your configured pattern." None of Issues 1-3 require a rewrite: Issue 3 is a few lines reusing the source config's existing table-filter logic, Issue 2 has a natural home in the existing checkpoint/split-state path, and Issue 1's most likely fix is narrowing one `synchronized` block's scope so it doesn't hold a lock across a network round-trip. I'd like to see those three closed, backed by a passing e2e run and a restart-across-discovery test, before this comes out of draft.
Because GitHub does not allow approving one's own pull request, this review is submitted as a plain comment rather than a formal review. It carries no approval weight, and merge still requires review and approval from another committer. The PR remains in **draft** state, and separately, GitHub currently reports this branch as `dirty` against `dev` (14 commits ahead, 14 behind) — the merge conflicts will need to be resolved before this can be merged regardless of the review outcome above.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7148797781
Thanks for the updates. This is the status on the unchanged head `34d388c9150d5bbf83591bbf1e3e3a930e342342`, limited to the earlier review points.
**Closed**
- The Zeta single-table case: the runtime `CreateTableEvent` is now registered when the job starts with exactly one matched table (source startup schema promotion).
- The JDBC precheck: `JdbcSinkFactory.supportsNewlyCreatedTable()` is now config-aware.
**Still open — code**
1. **Retry under the schema barrier (`MultiTableSinkWriter`)**: runtime writer creation is still retried while the sibling queue workers are parked at the barrier. One failing new table therefore holds healthy tables and checkpoint progress for the whole retry window. Please make retry/admission table-local so nothing waits through the retry delay under the shared barrier.
2. **Re-CREATE on an already registered path**: the early return still treats a second `CREATE TABLE` as a replay without proving the old and new schemas are equivalent. Please distinguish an idempotent duplicate CREATE from DROP followed by re-CREATE with changed columns, so that case does not leave stale converters and a stale sink schema.
3. **Unbounded runtime admission**: runtime-created writers and state still have no upper bound and no retirement path. Please add a limit and define how a runtime-admitted table is removed.
**Still open — docs (EN and ZH)**
- How the runtime option relates to `schema-changes.enabled`, and that it overrides a user-supplied `debezium { include.schema.changes }`.
- That `scan.binlog.newly-added-table.enabled` is rejected at startup when `table-names` is configured, in both the option row and the "Newly Added Tables" section.
- Which engines support runtime table registration, since the wiring is engine-specific.
Build 45009815106 was cancelled, so it does not clear any of the items above. When you push, could you note briefly how each of the three code items is handled, and which test covers it?
<!-- streview-comment:2600 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6190334215
Thanks @SEZ9. Taking your points in order, checked against `9007896511517e4b874142cfe704102861bbc444`.
**F3 (`scan.newly-added-table.enabled` default): already flipped to `false`.** `MySqlIncrementalSourceOptions.java:65-71` declares `defaultValue(false)`, and `docs/en/connectors/source/MySQL-CDC.md` (option table row and the "Newly Added Tables" section) states the default `false` retains only the checkpointed table set and that `true` must be set explicitly. So existing wildcard jobs keep their checkpoint-restore behavior after upgrade and no upgrade note is needed for this option. Sorry this was easy to miss in my status comment; it was in the first bullet group of the follow-up on this head.
**F1 / F8 test ask: agreed.** `MySqlSchemaTest` currently covers an unsafe name with a hyphen (`db1.unsafe-table`). I will add cases with a backtick and a `;`, plus a deserializer-level test asserting that a table whose identifier fails validation produces no `CreateTableEvent` and never reaches the sink. The MySQL-CDC doc already describes the enforced shape (ordinary unquoted identifier containing at least one letter, underscore or dollar sign); I will also add that all-numeric names are rejected and skipped with a WARN.
**F2, F4, F5, F6, F7:** as in my previous reply these are not done yet. F2 (Javadoc on both `supportsNewlyCreatedTable` declarations saying a runtime `CreateTableEvent` is never silently dropped and the job fails when the sink has not opted in), F7 (explicit `exactly_once = false` in the en and zh JDBC docs) and your F6 request (a restore test with an old-format `MultiTableState`) will land in the next code push together with F4 and F5.
**CI.** The fork Build on this head has two unrelated red groups: `all-connectors-it-2` (`CassandraIT` `testCassandra` and `testCassandraMultiTableSource`, container variant `[4]`, in `connector-cassandra-e2e`; this PR touches no Cassandra code) and `engine-v2-it` (`SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck`, a worker-loss cancel timing issue in the engine fault-tolerance suite). I will merge current `dev` with the next push and share the CI outcome then. I will ping once it is 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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7053289914
Thanks for the follow-up discussion. The thread still records the head as unchanged at `531db9be494e7c6aca617b45d3f8972045e75513`, so the earlier points remain open and nothing counts as delivered from discussion alone. Please address them together in a new commit, each with a regression test that exercises the runtime path.
**Blocking behavior**
- **PR11206-F2 (single initial table on Zeta):** `SeaTunnelSourceCollector` registers a runtime `CreateTableEvent` only when the produced type is a `MultipleRowType`. A job that starts with exactly one matched table must also learn the new table's row type.
- **PR11206-F1 (JDBC capability check):** `JdbcSinkFactory.supportsNewlyCreatedTable()` needs to be configuration-aware. An exactly-once or custom-`query` sink should be rejected before any writer, save-mode or quarantine side effect, and should fail the job rather than quarantine the table under `CONTINUE_OTHER_TABLES`.
- **PR11206-F5 (retries under the schema barrier):** Runtime writer creation in `MultiTableSinkWriter` retries with `TimeUnit.SECONDS.sleep` while every queue worker is parked. One failing new table must not stall the other tables and checkpoints for the whole retry window.
- **PR11206-F7 (DROP then re-CREATE):** A second `CREATE TABLE` for an already registered path must not be ignored in `SeaTunnelRowDebeziumDeserializeSchema`. The replacement schema has to refresh the converters and the sink schema.
- **PR11206-F8 (admission bound):** Runtime admission needs an upper bound and a removal path, so sink writers and checkpoint state cannot grow without limit.
**Docs (`docs/en/connectors/source/MySQL-CDC.md`)**
- **PR11206-F9:** State how the runtime option relates to `schema-changes.enabled`, and that it overrides a user-supplied `debezium { include.schema.changes }`.
- **PR11206-F10:** Document, in both the option row and the "Newly Added Tables" section, that `scan.binlog.newly-added-table.enabled` is rejected at startup when `table-names` is configured.
- **PR11206-F11:** State which engines support runtime table registration.
For PR11206-F8, could you also confirm which bound and removal behavior you intend to implement, so the docs can describe exactly that scope?
<!-- streview-comment:2497 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7086164738
@davidzollo thanks for the update. The re-review is not done yet: I'll take the two HIGH items against the commits you listed, and I need a status on the six findings your comment doesn't cover.
**Covered by your comment**
- **PR11206-F2 (single initial table on Zeta)**: I'll re-check this against `df80cd4e0360`. Please confirm there is a test where the job starts with exactly one matched table and the new table's row type is registered after a runtime `CreateTableEvent`.
- **PR11206-F1 (JDBC capability check)**: I'll re-check this against `34d388c9150d`. Please confirm two things:
- `JdbcSinkFactory.supportsNewlyCreatedTable()` now reflects the config for both the exactly-once and the custom-`query` cases.
- Under `CONTINUE_OTHER_TABLES`, such a sink now fails the job instead of quarantining the table.
- **Catalog & startup options (`ad4d43deff1c`, `56644bda06a8`)**: noted. This doesn't map to one of the previous findings, so I have nothing to add on it.
**Not mentioned yet**
For each of these, please say whether it is fixed (and in which commit) or intended as a follow-up:
- **PR11206-F5**: runtime writer creation retries with `TimeUnit.SECONDS.sleep` while every queue worker is parked at the schema-change barrier, so one failing new table stalls all tables and checkpoints for the retry window.
- **PR11206-F7**: a second `CREATE TABLE` for an already registered path is ignored, so DROP followed by re-CREATE with a different schema leaves stale converters and a stale sink schema.
- **PR11206-F8**: runtime admission has no upper bound and no removal path, so sink writers and checkpoint state can grow without limit.
- **PR11206-F9**: the docs don't say how the runtime option relates to `schema-changes.enabled`, or that it overrides a user-supplied `debezium { include.schema.changes }`.
- **PR11206-F10**: the docs don't say that `scan.binlog.newly-added-table.enabled` is rejected at startup when `table-names` is configured, in either the option row or the "Newly Added Tables" section.
- **PR11206-F11**: the docs don't say which engines support runtime table registration.
Please also post the outcome of fork build run 45009815106 once it finishes. With that and the answers above, I can finish the re-review on head `34d388c9150d5bbf83591bbf1e3e3a930e342342`.
<!-- streview-comment:2535 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7025820722
Thanks for the update. The quarantine lock boundary change does not by itself close the points from the previous review, so they are still open. Please address them together in the next commit:
**Code**
- **Single initial table on Zeta:** the runtime `CreateTableEvent` is registered only when the source produced type is a `MultipleRowType`. A job that starts with exactly one matched table therefore never learns the new table's row type.
- **JDBC capability check:** `JdbcSinkFactory.supportsNewlyCreatedTable()` returns `true` regardless of config. An exactly-once or custom-`query` sink is rejected only after a writer is built, and under `CONTINUE_OTHER_TABLES` the table is quarantined instead of failing the job. Please make the check configuration-aware.
- **Retries at the schema-change barrier:** writer creation is retried with `TimeUnit.SECONDS.sleep` while every queue worker is parked. One failing new table then stalls all tables and checkpoints for the whole retry window.
- **DROP followed by re-CREATE:** a second `CREATE TABLE` for an already registered path is ignored. A re-CREATE with a different schema leaves stale converters and a stale sink schema.
- **Runtime admission bound:** there is no upper bound and no removal path, so sink writers and checkpoint state can grow without limit.
**Docs (`MySQL-CDC.md`)**
- Explain how the runtime option relates to `schema-changes.enabled`, and that it overrides a user-supplied `debezium { include.schema.changes }`.
- Document that `scan.binlog.newly-added-table.enabled` is rejected at startup when `table-names` is configured, in both the option row and the "Newly Added Tables" section.
- State which engines support runtime table registration, since the wiring is engine-specific.
When you push, please add a short note on how each item was handled. For the single-initial-table and DROP/re-CREATE cases, please also say which test covers the behaviour. If you plan to handle any of these differently, such as the admission bound or the retry strategy, describe the approach here so we can agree on it first.
<!-- streview-comment:2474 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-5343030346
# What Problem Does This PR Solve?
**User pain point:** a MySQL CDC job configured with `table-pattern`/`database-pattern` cannot pick up a table created *after* the job starts. Debezium matches the new table's row events against the pattern at the source level, but SeaTunnel's reader never registers a schema/converter for it, so the rows are silently dropped, and the JDBC sink has no mechanism to create the corresponding target table on the fly.
**Fix approach:** the PR adds `scan.newly-added-table.enabled` (formalizes the pre-existing restore-time re-snapshot behavior, default `true`, no behavior change) and `scan.binlog.newly-added-table.enabled` (new, default `false`) — the latter is meant to parse the `CREATE TABLE` entry out of Debezium's `tableChanges` while the reader is already streaming binlog, build a `CatalogTable`, and emit a `CreateTableEvent`. On the sink side it adds `SupportMultiTableSinkWriter#createSinkWriter` and a `RuntimeSinkWriterFactory` hook so `MultiTableSinkWriter` can spin up a brand-new per-table JDBC writer at runtime and physically create the target table via `catalog.createTable(...)`.
**One-sentence summary:** the design direction is sound and the SeaTunnel-side wiring I re-traced this round is structurally correct, but I pulled the raw job log from this exact head's own CI run and found hard, direct evidence that the headline capability has never once completed end-to-end in any of the 10 executions of its own e2e test — this is a stronger finding than what earlier rounds on this PR reported, and it corrects an over-optimistic claim from my own previous round.
---
## Important correction to my own previous round (2026-08-18)
My last review on this exact head (`60d4e4155519`, unchanged since) stated: *"the normal streaming path does reach `handleTableChangeStruct`... the mechanism is now proven to reach the sink and materialize the table on every single one of 10 CI executions I inspected."* I went back to the actual CI job log for this same run this round (`mysql-cdc-connector-it (8, ubuntu-latest)`, run `32043314641`, job `95426735095`, https://github.com/DanielLeens/seatunnel/actions/runs/32043314641/job/95426735095) and that claim does not hold up:
- `grep -c "Registered newly added CDC table"` (the exact success log at `SeaTunnelRowDebeziumDeserializeSchema.java:152`, emitted only when `handleTableChangeStruct` actually registers a new table) against the full 233,089-line job log → **0 matches**, across all 10 test executions in the run.
- `grep -c "Registered runtime sink writer for newly created table"` (the sink-side success log at `MultiTableSinkWriter.java:751-753`) → **0 matches**.
- `grep -c "CreateTableEvent"` anywhere in the log (class name, in any stack trace or log line) → **0 matches**.
- Every one of the 10 executions of `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` (5 on `Mysql8_4CDCIT`, 5 on `MysqlCDCIT`, across engines) fails identically: `org.awaitility.core.ConditionTimeoutException: ... newly added wildcard sink table not readable yet: java.sql.SQLSyntaxErrorException: Table 'sink.source_payments' doesn't exist within 2 minutes`, with the whole test consistently costing 152-160s (i.e. exactly the 120s `awaitility` budget plus fixed setup overhead — not the tens-of-minutes-then-succeeds pattern I described last round).
- I did independently confirm the DML row for the new table *is* delivered to the reader: at `2026-08-17T20:43:48Z` the log shows a `READER_MESSAGE_DELAYED` event for `ConnectRecord{topic='mysql_binlog_source.source.payments', ... op=c, ...}` — Debezium is capturing binlog rows for the new table. But that is upstream of `deserialize()`/`shouldEmit()` filtering, not proof of successful registration, and the actual registration log never appears anywhere afterward.
I'm flagging this explicitly rather than quietly reissuing a corrected number, because it changes the merge-blocking finding from "works but too slow to demonstrate in CI" to "has never been observed to complete, in any execution, of its own test." I don't have a fully pinned root cause (see 1.1 below for what I did trace), but the empirical evidence is unambiguous, and it reconfirms — not refutes — the original concern raised earlier in this PR's history that the source-side registration ("Registered newly added CDC table") never fires on the real streaming path.
---
# 1. Code Change Review
## 1.1 Core Logic Analysis
**Files re-traced this round:** `SeaTunnelRowDebeziumDeserializeSchema.java`, `AbstractDebeziumDeserializationSchema.java`, `MySqlIncrementalSource.java`, `MySqlSourceConfigFactory.java`, `IncrementalSourceStreamFetcher.java` (source side, unmodified by this PR but on the critical path), `MultiTableSinkWriter.java`, `MultiTableSink.java` (sink side).
**What I verified is correctly wired (source-level, not just CI-observed):**
```java
// SeaTunnelRowDebeziumDeserializeSchema.java:126-154
protected void handleTableChangeStruct(Struct tableChangeStruct) {
if (!scanBinlogNewlyAddedTableEnabled || tableChangeCatalogTableConverter == null) {
return;
}
...
tables.add(catalogTable);
pendingCreateTables.add(catalogTable);
tableRowConverters = createTableRowConverters(...);
log.info("Registered newly added CDC table {}", catalogTable.getTablePath());
}
```
- `MySqlIncrementalSource.java:284-292` wires both `scanBinlogNewlyAddedTableEnabled` (from `SCAN_BINLOG_NEWLY_ADDED_TABLE_ENABLED`) and `tableChangeCatalogTableConverter` (a real `MySqlCatalogTableUtils.toCatalogTable(...)` lambda, not null) into the builder, so the early-return guard should not trip when the option is on.
- `MySqlSourceConfigFactory.java:105-107` sets Debezium's `include.schema.changes=true` whenever `scanBinlogNewlyAddedTableEnabled` is set, which is what's supposed to make Debezium emit `TABLE_CHANGES`-bearing history records for DDL encountered on the binlog.
- `AbstractDebeziumDeserializationSchema.java:65-77`'s `deserialize()` unconditionally calls `handleTableChangeStruct` for every record where `isSchemaChangeEvent(record)` is true, and `SeaTunnelRowDebeziumDeserializeSchema.deserialize()` calls `super.deserialize(...)` first (`:169`) — so there's no dead branch *inside this class*.
- `IncrementalSourceStreamFetcher.shouldEmit(...)` (`:265-294`, unmodified by this PR) returns `true` unconditionally for any record that is *not* a data-change record (`:293-294`), i.e. schema-change/DDL records are not filtered out by table-membership here. So the DDL-suppression, if it exists, is not in this filter.
- The e2e conf (`mysqlcdc_wildcards_with_newly_added_table.conf`) sets both `schema-changes.enabled=true` and `scan.binlog.newly-added-table.enabled=true`, and `table-pattern="source.*\\..*"` does match `source.payments`.
**What actually happens in CI (the part that matters):** despite all of the above being wired correctly at the layer I can read statically, the success log at the end of `handleTableChangeStruct` never fires. The most likely remaining candidates are further upstream than this PR's diff — in how the custom `EmbeddedDatabaseHistory` (used at `MySqlSourceConfigFactory.java:94`, not part of this diff) interacts with Debezium's actual DDL-to-history-record emission for a table `CREATE`d after the connector has already left the snapshot phase, or in the per-table watermark bookkeeping in `IncrementalSourceStreamFetcher`'s data-record path swallowing the record before a schema-change record is ever produced for it. I was not able to fully pin this down through static reading in the time available; I flag it as the concrete next investigation step rather than guessing further.
**Key findings:**
1. The SeaTunnel-side wiring for this feature (config plumbing, builder wiring, event dispatch, filter pass-through) is structurally sound wherever I could verify it directly.
2. Despite that, the feature's success path has literally never been observed to fire in any of the 10 executions of its own e2e test in the current CI run for this exact head.
3. This is not a defensive fix or workaround — it is meant to be the PR's headline capability — and it is currently inert on the one path that's supposed to prove it: the job's own binlog-streaming e2e test.
4. Because the failure is 10/10 reproducible with an identical error and identical timing envelope, this reads as a deterministic gap, not CI flakiness or a slow-but-working mechanism.
**Runtime path (intended, per source; the point marked ✗ is where CI evidence says it actually stops)**
```text
Binlog streaming phase (scan.binlog.newly-added-table.enabled = true)
-> Debezium/EmbeddedDatabaseHistory should deliver a schema-change record for "CREATE TABLE source.payments"
-> IncrementalSourceStreamFetcher.shouldEmit(record) -> true (non-data-change records pass through) [:293-294]
-> AbstractDebeziumDeserializationSchema.deserialize() [:65-77]
-> handleTableChangeStruct(tableChangeStruct) [SeaTunnelRowDebeziumDeserializeSchema.java:127-154]
-> log.info("Registered newly added CDC table {}", ...) ✗ NEVER OBSERVED IN CI (0/233089 log lines)
-> emitPendingCreateTableEvents(...) -> CreateTableEvent ✗ never observed (0 matches for "CreateTableEvent" anywhere in the log)
Sink side (MultiTableSinkWriter.registerNewlyCreatedTable) ✗ never reached (0 matches for its success log)
Test assertion
-> queryNewlyAddedWildcardSinkTable() polls "sink.source_payments" for 120s
-> ConditionTimeoutException every time: "Table 'sink.source_payments' doesn't exist" (10/10 executions, ~153-160s each)
```
## 1.2 Compatibility Impact
**Partially incompatible.**
- `scan.binlog.newly-added-table.enabled` defaults to `false` — no behavior change for existing jobs that don't opt in.
- `scan.newly-added-table.enabled` defaults to `true` and formalizes the pre-existing restore-time re-snapshot behavior — no behavior change.
- Checkpoint/state structure is unchanged; old checkpoints remain structurally loadable.
- One real, always-on compatibility change: `MultiTableSink.registerAggregatedFlush(...)` is now invoked unconditionally from both `createWriter` (`MultiTableSink.java:174`) and `restoreWriter` (`:245`) for *every* `MultiTableSink`, not just jobs using this new feature — see Issue 5 below.
## 1.3 Performance / Side-Effect Analysis
- `MultiTableSinkWriter.registerNewlyCreatedTable` (`:683-757`) holds `synchronized (runnable.get(i))` (`:691`) across the entire per-queue writer creation, including `runtimeSinkWriterFactory.create(catalogTable, context)` (`:713`), which for JDBC ends in a live `catalog.createTable(...)` DDL round-trip in `AbstractJdbcSinkWriter`. This is a lock held across blocking I/O; under `multi_table_sink_replica > 1` or high per-queue contention this serializes registration and is a real, if currently unobserved-in-passing-CI, latency/contention risk. I re-confirmed this pattern is unchanged this round.
- `tableRowConverters` is rebuilt for the *entire* `tables` list every time a single new table is registered (`SeaTunnelRowDebeziumDeserializeSchema.java:146-151`) — O(all known tables) per discovery event, not O(1).
- No upper bound on the number of runtime-registered tables; a broad `table-pattern` combined with `scan.binlog.newly-added-table.enabled=true` can accumulate sink writers without limit.
## 1.4 Error Handling and Logging
**Issue 1: The feature's own success path has never been observed to fire in CI; its e2e test fails deterministically, not intermittently**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:152` (never-logged success line); `MultiTableSinkWriter.java:751-753` (never-logged sink-side success line); test at `seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e/src/test/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/AbstractMysqlCDCITBase.java:845-881`
- **Problem description:** In the current head's own CI run (`mysql-cdc-connector-it (8, ubuntu-latest)`, https://github.com/DanielLeens/seatunnel/actions/runs/32043314641/job/95426735095), `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` fails all 10/10 times it runs (5 container variants x 2 engine test classes) with the identical error `Table 'sink.source_payments' doesn't exist within 2 minutes`, each execution costing ~153-160s (bounded by the 120s `await()` plus fixed overhead — not a slow-but-eventually-successful pattern). Neither of the two success log lines that would prove the mechanism worked appear anywhere in the 233k-line job log, and the string `CreateTableEvent` does not appear anywhere either (not even in a stack trace). I did confirm Debezium *is* delivering DML for the new table to the reader (a `READER_MESSAGE_DELAYED` event for `source.payments` row `id=2001` at `20:43:48Z`), so the gap is specifically in the DDL/schema-change registration path, not in bi
nlog delivery generally.
- **Potential risk:** the PR's headline capability — binlog-driven newly-added-table discovery — does not currently work at all on the one path built to demonstrate it. Merging this as-is ships a documented, opt-in feature (`docs/en/connectors/source/MySQL-CDC.md`'s new "Newly Added Tables" section) that a user who enables it will find silently does nothing: rows for the new table are captured by Debezium but permanently dropped (`SeaTunnelRowDebeziumDeserializeSchema.java:328-331`, at `log.debug`, so effectively invisible operationally) because the table's converter and the sink's writer are never registered.
- **Best improvement:** before this can be considered for merge, get `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` passing against a real run and confirm the "Registered newly added CDC table" log actually appears. The most productive place to continue tracing is upstream of this PR's diff: how `EmbeddedDatabaseHistory` (`MySqlSourceConfigFactory.java:94`) surfaces DDL processed after the connector has already left the snapshot phase, and whether a schema-change `SourceRecord` is actually produced/queued for `CREATE TABLE source.payments` at all before it ever reaches `AbstractDebeziumDeserializationSchema.deserialize()`.
- **Severity:** High (Blocker)
- **Raised by another reviewer:** No — this specific "never fires in CI, not just slow" framing is new evidence from this round; it corrects a more optimistic characterization from my own 2026-08-18 comment on this same PR, which I'm superseding here.
**Issue 2 — A binlog-registered table is not checkpointed and would be silently forgotten after any restart**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:121-124`,`:144-152` (`tables`/`tableRowConverters` are plain mutable fields, no checkpoint-state hook); `MultiTableSink.java:199-230` (`restoreWriter` iterates only `sinks.keySet()`, the config-time table set — re-verified this round by direct read)
- **Problem description:** `restoreWriter` never sees a table registered purely at runtime via `registerNewlyCreatedTable`, because that registration only mutates in-memory maps on the live `MultiTableSinkWriter` instance and is never folded into `MultiTableState`.
- **Potential risk:** would be silent, permanent data loss for exactly the tables this feature exists to capture, on the next restart — a routine event for a long-running CDC job. (This is currently unobservable in practice only because Issue 1 means the table is never successfully registered in the first place; it becomes a live risk the moment Issue 1 is fixed.)
- **Best improvement:** persist the set of runtime-registered `CatalogTable`s/`TablePath`s into checkpoint state so restore can re-run the equivalent of `registerNewlyCreatedTable` on recovery.
- **Severity:** High
- **Raised by another reviewer:** No.
**Issue 3 — No capture-pattern check before registering a table discovered from binlog DDL**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:127-154` (re-verified: `handleTableChangeStruct` only checks `containsTable` for dedup, never re-checks the new table's path against `table.include.list`/`table-pattern`)
- **Problem description:** every `TableChangeType.CREATE` observed is registered unconditionally, with no filter against the configured capture pattern.
- **Potential risk:** directly contradicts this PR's own new documentation (`docs/en/connectors/source/MySQL-CDC.md`: "The new table must match the configured capture pattern") — the doc makes a scoping promise the code does not enforce. A job capturing `orders_.*` could start registering `audit_log` the moment it's created in the same database.
- **Best improvement:** apply the same table-filter logic the connector already uses elsewhere inside `handleTableChangeStruct` before `tables.add(catalogTable)`.
- **Severity:** High
- **Raised by another reviewer:** No.
**Issue 4 — `CreateTableEvent` bypasses `schemaChangeEventFilter`**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:194-196` (`emitPendingCreateTableEvents` returns `true`, short-circuiting before the filter) vs. `:213-215` (the filter every other schema-change event goes through) — re-verified by direct read this round.
- **Problem description:** every other schema-change event is passed through `schemaChangeEventFilter.filter(...)` before being collected; `CreateTableEvent`s are not.
- **Potential risk:** a user who excludes schema changes via `schema-changes.exclude` would still receive `CreateTableEvent`s for newly discovered tables — inconsistent with the rest of the same job's configuration.
- **Best improvement:** route the emitted `CreateTableEvent` through `schemaChangeEventFilter` before `collector.collect(...)`, same as the rest of the method.
- **Severity:** Medium-High
- **Raised by another reviewer:** No.
**Issue 5 — Aggregated flush is now registered unconditionally for every multi-table sink job, not just this feature's users**
- **Location:** `MultiTableSink.java:174` (`createWriter`), `:245` (`restoreWriter`), both calling `registerAggregatedFlush(context, writer)` (`:291-293`) — re-verified by direct read this round.
- **Problem description:** every `MultiTableSink`, including jobs that never touch `scan.binlog.newly-added-table.enabled`, now registers this new flush action on upgrade.
- **Potential risk:** a runtime-behavior change for existing production multi-table-sink jobs outside the opt-in envelope the rest of this PR otherwise maintains.
- **Best improvement:** gate `registerAggregatedFlush` behind whether `runtimeSinkWriterFactory` is non-null, rather than calling it unconditionally.
- **Severity:** Medium
- **Raised by another reviewer:** No.
**Issue 6 — Single-table jobs bypass the unknown-table guard entirely**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:317-335`, the `else` branch at `:333-335` — re-verified by direct read this round.
- **Problem description:** the `tables.size() > 1` guard that protects against forwarding rows for an unregistered table only applies to the multi-table branch; the single-table `else` branch unconditionally uses `DEFAULT_TABLE_NAME_KEY`.
- **Potential risk:** low today (a single-table job has no meaningful newly-added-table scenario), but an inconsistency that would surface if this code is reused for a job that starts single-table and later gains tables.
- **Best improvement:** apply the same `tableId`-keyed lookup in both branches, or document why the single-table path is exempt.
- **Severity:** Medium
- **Raised by another reviewer:** No.
**Issue 7 — Duplicated builder call, unfixed across multiple review rounds**
- **Location:** `MySqlIncrementalSource.java:282-283` — re-confirmed present, unchanged, this round.
- **Problem description:** `.setSchemaChangeEventFilter(SchemaChangeEventFilter.fromConfig(config))` appears twice in a row, identically.
- **Potential risk:** none functionally (idempotent), but a signal that small, easy review comments on this PR aren't being worked through.
- **Best improvement:** delete the duplicate line.
- **Severity:** Low
- **Raised by another reviewer:** No.
**Issue 8 — Silently no-ops in `table-names` mode, with no validation**
- **Location:** `MySqlSourceConfigFactory.java:133-136` (`table.include.list` set from the fixed `tableList` when `table-names` is used, not a pattern).
- **Problem description:** `scan.binlog.newly-added-table.enabled` is only meaningful when new tables can match a pattern; in `table-names` mode the include list is a fixed enumeration, so no table created after job start can ever match. There is no validation warning about this combination.
- **Best improvement:** reject or warn in the factory's option validation when `scan.binlog.newly-added-table.enabled=true` is combined with `table-names`.
- **Severity:** Medium
- **Raised by another reviewer:** No.
No sensitive data is logged anywhere in the new code.
---
# 2. Code Quality Assessment
## 2.1 Coding Standards
Javadoc is present on new public/protected methods (`handleTableChangeStruct`, `registerNewlyCreatedTable`, `registerAggregatedFlush`, `isScanNewlyAddedTableEnabledOnRestore`, the new `Option`s), no wildcard imports, no `System.out.println`, ASF headers present on new files. The `containsTable` and `emitPendingCreateTableEvents` Javadocs are clear about *why*, not just *what*. Issue 7's duplicated line is the one concrete, trivial miss.
## 2.2 Test Coverage and Test Stability
**Stability rating: High risk.**
- `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` fails deterministically (10/10) at the current head — see Issue 1. Per the review protocol's rule, a test that cannot pass in CI must be rated High risk regardless of suspected root cause.
- The `Awaitility` polling itself is well-structured (`untilAsserted`, condition-based) and the most recent commit (`60d4e4155519`, "[Test][E2E] Retry newly-added wildcard sink polls...") correctly fixes a real bug where `query()`'s `SQLException`-wrapped-in-`RuntimeException` was aborting the poll on its first legitimate "table not created yet" hit instead of retrying — I confirmed this fix is syntactically correct and does not itself explain Issue 1 (the underlying table genuinely never gets created within the test's lifetime, retried or not).
- No new test restarts a job across the table-addition window (would exercise Issue 2), no negative test asserts a non-matching table is *not* registered (would catch Issue 3), no test for `schema-changes.exclude` interaction with `CreateTableEvent` (would catch Issue 4), no test for the `table-names` mode combination (would catch Issue 8). Only one new e2e conf (`mysqlcdc_wildcards_with_newly_added_table.conf`) exists, and it doesn't currently pass.
- No hard-coded ports, no shared static state, no order-dependent assertions observed in the new test code itself.
## 2.3 Documentation Updates
`docs/en/connectors/source/MySQL-CDC.md` and `docs/zh/connectors/source/MySQL-CDC.md` were both updated (8 lines each) with a new options table rows and a "Newly Added Tables" subsection. Problems:
- The doc's claim "The new table must match the configured capture pattern" is not enforced by the code (Issue 3).
- No mention that a runtime-discovered table is lost on restart (Issue 2).
- No mention of the `table-names` mode restriction (Issue 8).
- Most importantly right now: the documented behavior ("registers table metadata from the CREATE TABLE schema record and then reads following DML records for that table") does not match what the current CI run demonstrates (Issue 1).
---
# 3. Architectural Soundness
## 3.1 Elegance of the Solution
The binlog-ordering insight (MySQL cannot emit a row event for a table before its own `CREATE TABLE`, so there's no missed-event race on discovery ordering itself) is sound, and the base-class hook design (`handleTableChangeStruct` as an overridable no-op) is clean. But given Issue 1, this is currently best classified as an **incomplete implementation of a precise-fix design** — the architecture is right, the mechanism as implemented and shipped in this diff does not demonstrably work.
## 3.2 Maintainability
`handleTableChangeStruct`, `registerNewlyCreatedTable`, and `restoreWriter` each touch overlapping "what tables does this job know about" state through three different, uncoordinated data structures (`tables`/`tableRowConverters` on the source; `sinks`/`sinkWritersWithIndex` on the sink), none backed by checkpoint state for the runtime-added case. That's the root of Issue 2 and would benefit from a single source of truth before this is extended further.
## 3.3 Extensibility
The `RuntimeSinkWriterFactory`/`SupportMultiTableSinkWriter#createSinkWriter` pattern is a reasonable, reusable extension point for other sink connectors to support runtime table creation in the future, independent of whether the source-side mechanism above is fixed.
## 3.4 Historical-Version Compatibility
No checkpoint/state schema change, no serialization format change for existing checkpoints. Issue 5 (unconditional aggregated-flush registration) is the one behavior change affecting existing jobs on upgrade.
---
# 4. Issue Summary
| # | Issue | Location | Severity |
|---|---|---|---|
| 1 | Feature's own e2e test fails deterministically (10/10) at current head; success logs on both source and sink side never appear in CI | `AbstractMysqlCDCITBase.java:845-881`; `SeaTunnelRowDebeziumDeserializeSchema.java:152`; `MultiTableSinkWriter.java:751-753` | High (Blocker) |
| 2 | Binlog-registered table not checkpointed; would be silently forgotten after restart | `SeaTunnelRowDebeziumDeserializeSchema.java:121-152`; `MultiTableSink.java:199-230` | High |
| 3 | No capture-pattern check before registering a DDL-discovered table; contradicts PR's own docs | `SeaTunnelRowDebeziumDeserializeSchema.java:127-154` | High |
| 4 | `CreateTableEvent` bypasses `schemaChangeEventFilter` | `SeaTunnelRowDebeziumDeserializeSchema.java:192-215` | Medium-High |
| 5 | Aggregated flush registered unconditionally for all multi-table sink jobs on upgrade | `MultiTableSink.java:174`, `:245`, `:291-293` | Medium |
| 6 | Single-table jobs bypass unknown-table guard | `SeaTunnelRowDebeziumDeserializeSchema.java:317-335` | Medium |
| 7 | Duplicated `.setSchemaChangeEventFilter(...)` call, unfixed across rounds | `MySqlIncrementalSource.java:282-283` | Low |
| 8 | Silently no-ops in `table-names` mode, no validation or doc note | `MySqlSourceConfigFactory.java:133-136` | Medium |
---
# 5. Merge Recommendation
### Conclusion: Not recommended for merge
**1. Blockers — must be fixed**
- **Issue 1** — the feature's own e2e test does not pass, and there is no CI evidence anywhere in the current run that the source-side registration (`"Registered newly added CDC table"`) or sink-side registration ever succeeds. This needs to be root-caused (see the "next investigation step" note in Issue 1) and demonstrated passing before this can move forward — not worked around with a longer timeout, since the current run shows no sign of eventual success either.
- **Issue 2** — no checkpoint persistence for runtime-registered tables; becomes a live silent-data-loss risk the moment Issue 1 is fixed.
- **Issue 3** — no capture-pattern filter on binlog-discovered tables, contradicting the PR's own documentation.
**2. Recommended fixes — non-blocking**
- Issue 4 (schema-change filter bypass), Issue 5 (unconditional aggregated-flush registration), Issue 6 (single-table guard inconsistency), Issue 8 (`table-names` no-op with no validation) — real but narrower in blast radius than the blockers above.
- Issue 7 (duplicated line) — trivial, easy to fold into the same pass.
**Overall assessment**
The design direction remains reasonable and the parts of the implementation I could verify statically (config plumbing, event dispatch, filter pass-through, the sink-side extension point) are wired correctly. But this round's contribution is a correction, not a reconfirmation: going back to the actual CI log for the exact current head rather than trusting my own prior notes, I found zero evidence — not "slow" evidence, zero evidence — that the mechanism this PR is meant to add has ever completed successfully. That's a more fundamental gap than "needs a longer test timeout," and it should be root-caused (I'd start by checking whether `EmbeddedDatabaseHistory` actually produces a schema-change `SourceRecord` for a table `CREATE`d after the connector leaves the snapshot phase — that's the one link in the chain I could not verify by reading source alone) and demonstrated with a genuinely passing e2e run before the durability (Issue 2) and scoping (Issue 3) gaps are worth investi
ng further review cycles in.
Because GitHub does not allow approving one's own pull request, this review is submitted as a plain comment rather than a formal review. It carries no approval weight, and merge still requires review and approval from another committer. The PR remains in **draft** state; GitHub currently reports `mergeStateStatus=DIRTY`/`mergeable=CONFLICTING` against `dev`, which will need to be resolved independently of the findings above. Separately from this feature's own test, this run also shows failures in `Dead links` (pre-existing/unrelated — it's reporting 404s for files that don't exist in `dev` itself, e.g. `docs/en/developer/new-license.md`, `plugin-mapping.properties`, unrelated to this PR's diff), `unit-test (windows-latest)`, `Dependency licenses`, `engine-k8s-it`, `transform-v2-it-part-1`, and `all-connectors-it-5`; I did not have time this round to individually root-cause each of those against `dev`, so I'm not asserting they're PR-caused, but they should be checked before this
is considered CI-green even after Issue 1 is fixed.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6166326971
Thanks @SEZ9. Here is what I verified in the code at `9007896511517e4b874142cfe704102861bbc444`, including the places where your ask is not fully met yet.
**Is the deserializer the only path for runtime names? Yes, in main code.**
- The only production construction of a runtime `CreateTableEvent` is `SeaTunnelRowDebeziumDeserializeSchema.java:323`, fed from `pendingCreateTables`, which is filled only in `handleTableChangeStruct` (`:130-165`).
- That method obtains the `CatalogTable` only through `tableChangeCatalogTableConverter`, and the MySQL wiring at `MySqlIncrementalSource.java:296-301` uses `MySqlCatalogTableUtils.toRuntimeCatalogTable`, which first runs `validateRuntimeTableIdentifiers` on database, schema, table, every column and every primary-key column against the `[A-Za-z0-9_$]*[A-Za-z_$][A-Za-z0-9_$]*` pattern (digit-leading names such as `2024_orders` pass, all-numeric names fail). An `IllegalArgumentException` is caught at `:146-152`, logged at WARN and that table is skipped.
- Because the sink only ever receives the validated `CatalogTable`, the generated SQL and the `${database_name}_${table_name}` template are built from validated names. I did not add a second check where the SQL is built; the guarantee rests on this single boundary. Tables restored from a checkpoint (`pendingRestoreTables`, `:510-521`) were validated when first registered.
**Javadoc on the fail-fast contract: not done yet.** The fail-fast behavior exists (`MultiTableSinkWriter.java:508-513` throws an `IOException` naming the sink type and table path when the factory does not opt in), but the Javadoc of `SupportMultiTableSinkWriter#supportsNewlyCreatedTable` and `TableSinkFactory#supportsNewlyCreatedTable` only says "connectors must opt in". They do not say that a runtime `CreateTableEvent` is never silently dropped. That is a real gap and I will add it with the next code push.
**JDBC sink docs: partly done.** `docs/en|zh/connectors/sink/Jdbc.md` mention `generate_sink_sql = true` and say runtime table creation is not supported with JDBC exactly-once, but they do not spell out the literal `exactly_once = false` setting. I will make that explicit in the same push.
F4 (target-scope pinning), F5 (writer-creation `IOException` retry/idempotency) and F6 (old-format `MultiTableState` restore note and test) are still open and will come with the same push; I am not claiming them resolved. Local compilation and tests were not run for this reply, and CI on the current head is the gate.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6462211676
@SEZ9 The review fixes are pushed at `03973e5cbd3d7f215f80aa2e38e0fe9f053c00ab`, including an upstream `dev` sync to `cec3276740d989c8cb67c7b8c37e0a817e728059`. GitHub now reports `MERGEABLE`; the PR remains open and non-draft. No PR-specific POM or workflow changes were added.
- **F1/F8 and unsupported types:** real MySQL converter tests now cover backticks, semicolons, all-numeric names and unsupported column types, including repeated CREATE records and subsequent DML. Only the unsupported-type error is translated at the MySQL runtime admission boundary; unrelated failures still propagate. Rejected tables emit no CREATE or rows. Docs explicitly describe this WARN-and-skip exclusion.
- **F2:** both capability SPIs now document the fail-fast contract, and dispatch rejects unsupported sinks rather than silently dropping CREATE.
- **F4:** CREATE identity must match its catalog metadata. CREATE stays source-scoped even when another writer shares the physical target; ALTER retains its existing broadcast behavior. JDBC DDL uses the resolved sink target, options and schema, not the source event's target metadata.
- **F5 and save modes:** runtime JDBC CREATE honors schema save modes through the ordered handler. Replay does not drop/truncate existing tables or re-run custom SQL. Registration follows the existing failure policy: immediate task failure for FAIL_FAST, configured retries then table quarantine for CONTINUE_OTHER_TABLES. Writers rejected before installation are closed before retry.
- **F6:** the old serialized MultiTableState fixture now asserts an empty runtime-table list. The documentation distinguishes old-state restore from unsupported downgrade of new-feature checkpoints.
- **F7:** both language docs and the E2E configuration now use JDBC's actual option, `is_exactly_once = false`, together with `generate_sink_sql = true` and no custom `query`.
- **Other review findings:** restored legacy empty/absent `primary_keys` inheritance; appended CREATE_TABLE to preserve existing enum ordinals; replaced the new-table E2E's startup sleep with a replicated mutation barrier and added exact-name unsafe-table cleanup in `finally`.
**Correction to F3:** my earlier statement that default `false` preserves existing restore behavior was incorrect. On [upstream dev](https://github.com/apache/seatunnel/blob/cec3276740d989c8cb67c7b8c37e0a817e728059/seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/IncrementalSource.java#L378), hybrid restore already calls `restore(...)` unconditionally and [adds newly matched tables](https://github.com/apache/seatunnel/blob/cec3276740d989c8cb67c7b8c37e0a817e728059/seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/IncrementalSource.java#L435). The option therefore defaults to `true` to preserve that behavior, with explicit `false` as the opt-out. Runtime binlog discovery remains default-off. `testRestorePreservesNewTableDiscoveryDefault` exercises the actual restoreEnumerator entry point for omitted/true/false configurations.
### Regression Coverage
| Test | Regression guarded |
| --- | --- |
| `testResolveSinkTableExplicitEmptyPrimaryKeysInheritsSourcePrimaryKey` | Legacy empty primary_keys must not turn upserts into inserts |
| `testRuntimeAdmissionUsesRealConverterBeforeEmittingEvents` | Rejected schemas must not emit CREATE/data or poison subsequent tables |
| `testUnsupportedRuntimeTypeIsClassifiedWithoutMaskingOtherFailures` | Skip only supported admission failures, not unrelated faults |
| `testRuntimeCreateRejectsMismatchedIdentityBeforeFactory` | Source event identity cannot redirect runtime registration |
| `createTableDoesNotReinitializeSiblingsSharingThePhysicalSink` | CREATE isolation without regressing ALTER broadcast |
| `testRuntimeRegistrationFailurePolicy`, `testRuntimeTableRegistrationRetriesWriterCreation` | Retry exhaustion, quarantine and successful CREATE replay |
| `testRuntimeRegistrationRetryClosesUninstalledWriter` | Failed registration attempts must not leak writers |
| `testRuntimeCreateHonorsSaveModeAndResolvedTarget`, `testRuntimeCreateReplayKeepsExistingTarget` | Configured target/save modes and non-destructive replay |
| `testRestorePreservesNewTableDiscoveryDefault` | Existing hybrid-restore discovery remains the default |
| Existing serialized-state fixture and runtime MySQL E2E | Old-state defaults, real unsafe identifiers, valid new-table insert/update/delete |
**Validation:** Spotless apply/check passed for API, CDC base, CDC MySQL, JDBC and MySQL CDC E2E; `git diff cec3276740d989c8cb67c7b8c37e0a817e728059 --check` passed. Independent static review of the addressed fixes completed. Local compilation/tests/Docker were not run under this workspace's SeaTunnel rule; these added tests still need exact-head CI execution.
At 06:18 UTC, the [fork Build](https://github.com/DanielLeens/seatunnel/actions/runs/40642768471) had Code style running and three initial jobs queued. [Upstream PR signal](https://github.com/apache/seatunnel/actions/runs/40642775355) reports `action_required`. The required Build result is not green yet. I have not rerun or cancelled those jobs, and have not merged the PR.
The recommended table-count cap and DROP/RENAME cleanup remain outside this phase; docs now explicitly prohibit unbounded ephemeral-table workloads. This is a documented limitation, not a claim that resource growth is solved.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6594199885
Pushed `c3d11fc6475` (two commits on top of `d4faf1ea1aa`, no production code changed) for the blockers listed in the latest review.
**1. Wildcard E2E failure (Issue 4), `95b4946ee39`.** Both MySQL CDC jobs of run 41164176211 ([JDK 11](https://github.com/DanielLeens/seatunnel/actions/runs/41164176211/job/124440278792), [JDK 17](https://github.com/DanielLeens/seatunnel/actions/runs/41164176211/job/124440278762)) failed only in `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` (10/10 errors, `ConditionTimeout` at `AbstractMysqlCDCITBase:1325`). The log shows the cause before the timeout:
```
ConnectException: The Kafka Connect schema name 'mysql_binlog_source.source.payments_rt_...`bad.Value' is not a valid Avro schema name and its replacement 'mysql_binlog_source.source.payments_rt_..._bad.Value' conflicts with another different schema
```
Debezium sanitizes both `<prefix>;bad` and `` <prefix>`bad `` to `<prefix>_bad` and stops the connector, so SeaTunnel's identifier admission never sees the second CREATE and the valid runtime table is never delivered. The fixtures are now `<prefix>_semicolon;bad` and `` <prefix>_backtick`bad ``: both unsafe characters are still exercised, their sanitized names differ, and all assertions, waits and cleanup are unchanged.
**2. Runnable example, `c3d11fc6475`.** Added `driver = "com.mysql.cj.jdbc.Driver"` to the EN/ZH MySQL-CDC runtime-table example (required by `JdbcSinkFactory.optionRule`, as in the E2E config).
**3. Downgrade restriction.** Recorded in `docs/{en,zh}/introduction/concepts/incompatible-changes.md`: checkpoints that contain runtime-registered tables cannot be restored by a version without this feature; old-format checkpoints still restore; jobs with `scan.binlog.newly-added-table.enabled = false` (the default) are unaffected.
@SEZ9, your F1-F8 status questions were answered item by item in my review of `d4faf1ea1aa`; nothing in this push changes those answers.
Only `spotless:apply`/`spotless:check` on the MySQL CDC E2E module were run locally. The current-head MySQL CDC result will come from the fork Build for `c3d11fc6475`; I will not claim it before it has run.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6514226425
Thanks @SEZ9. I checked the reported branch directly: MultiTableSinkWriterTest.java:230-234 expects IOException only for FAIL_FAST; line 234 is the other-policy branch, which calls applySchemaChange without expecting an exception. Its injected writer factory at :224-226 throws IOException("runtime registration unavailable"). CI reports the propagated IOException at :234, so this is the runtime-registration failure-policy path, not a generic runner-startup signal. Please preserve that failing case and correct the policy/registration behavior rather than suppressing the test or assuming an upstream sync resolves it. The P0 deadlock/recovery-table-loss and include-filter contracts from the existing full review remain open independently. The latest dev changes do not supply a registration-policy fix. Earlier identifier/default/documentation items already reconciled in the full review should not be reopened solely from an older discussion checklist.
Snapshot 2026-10-30T03:23:54.162575+00:00: head `03973e5cbd3d7f215f80aa2e38e0fe9f053c00ab`; [Signal pull request update](https://github.com/apache/seatunnel/actions/runs/40642775355/job/122796019439) = `SUCCESS`; [Build](https://github.com/apache/seatunnel/runs/122809387163) = `FAILURE`.
Base `dev`; comparison `diverged`, ahead 27, behind 22; merge state `blocked`. Behind/diverged alone is recorded metadata and does not add a sync request. This is an unchanged-head discussion/CI clarification, not a new complete source review, an effective approval or a dismissal of historical requested changes.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-5350357361
Follow-up self-check, ~12 hours after my last comment on this same head (`60d4e4155519`, unchanged — no new commit, no new discussion since). Re-deriving the full analysis again against a byte-identical diff wouldn't add anything on top of that comment, so this is a live re-verification of the two things most likely to have moved: CI and merge state.
- **CI** — still `Build: fail` on this SHA, consistent with the deterministic (10/10) `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` failure documented in my last comment (source-side `"Registered newly added CDC table"` and sink-side `"Registered runtime sink writer for newly created table"` logs still never appear; `CreateTableEvent` still never appears anywhere in the job log for this head).
- **Merge state** — still `mergeStateStatus=DIRTY` / `mergeable=CONFLICTING` against `dev`. Divergence has narrowed slightly (`ahead_by=14`, `behind_by=18`, vs. `behind_by` in the high-30s/40s range on some earlier rounds of other PRs in this same author's queue), but the conflict itself is unresolved.
- Nothing in this window changes the three High blockers from my last comment: (1) the feature's own e2e test has never been observed to pass, (2) a binlog-registered table isn't checkpointed and would be silently lost on restart, (3) no capture-pattern filter is applied before registering a DDL-discovered table, contradicting this PR's own documentation.
This remains the live technical conclusion for this diff — I'm not aware of anything in the intervening ~12 hours that would change it.
### Conclusion: Not recommended for merge
Unchanged from my last comment: root-cause and fix the e2e test failure (Issue 1) before investing further review cycles in the durability (Issue 2) and scoping (Issue 3) gaps, then resolve the `dev` conflict independently of the above. As before, this is posted as a plain comment rather than a formal review since GitHub does not allow self-approval; it carries no approval weight and merge still requires review from another committer.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6160641496
Thanks for the follow-up on `9007896511517e4b874142cfe704102861bbc444` and for syncing with `apache/dev` at `b0f6feddf9ed0dc1f5d485cfc69d387edfe6ac82`.
Going through the previous points based on your description; I'll confirm each against the diff:
- **F3 (`scan.newly-added-table.enabled` default)** — making it opt-in (`false`) is the right direction for restore compatibility of existing wildcard jobs, and thanks for updating both the English and Chinese MySQL CDC docs.
- **F2 (runtime-sink capability gate)** — failing early with the sink type and table path for a sink that does not opt in is the behavior we want. One ask: please make sure the Javadoc on `SupportMultiTableSinkWriter` / the `TableSinkFactory` default spells out this fail-fast contract, so implementers know a runtime `CreateTableEvent` is never silently dropped.
- **F1 / F8 (identifier enforcement)** — WARN-and-skip at the deserializer boundary with a negative regression test, plus accepting digit-leading names like `2024_orders` while rejecting all-numeric names, sounds like it addresses both points. Please confirm that the deserializer is the only path through which runtime-discovered names reach the generated sink SQL and the `${database_name}_${table_name}` template, or that the same check is applied where the SQL is built as well.
- **F7 (JDBC sink docs)** — thanks for adding the English and Chinese JDBC sink documentation. Please make sure it states the `exactly_once = false` / `generate_sink_sql = true` constraints for runtime-created tables.
Still open, as you noted:
- **F4 (target-scope pinning):** a source-side CREATE TABLE should only be able to trigger DDL in the explicitly configured sink target; please add strict routing/target validation or explain why the current gate is sufficient.
- **F5 (retry/idempotency):** we need a defined behavior when runtime writer creation throws `IOException` — either retry with idempotent table creation, or fail the task — so a transient failure cannot orphan the table while its binlog rows keep flowing.
- **F6 (checkpoint format):** please document old-format `MultiTableState` restore and rollback behavior, and add a restore test from a pre-change checkpoint if feasible.
Since local compilation and tests were not run, I'll wait for CI to finish before a final pass. A short note on the `MySqlIncrementalSourceFactory` conflict resolution (which guards were kept from dev and which options came from this PR) would also help reviewers verify the merge.
<!-- streview-comment:1750 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6207394196
Thanks for the detailed status on `9007896511517e4b874142cfe704102861bbc444`. Going through the points:
**F3** — Good, if `scan.newly-added-table.enabled` already defaults to `false` on this head and the MySQL-CDC doc states that explicitly, then existing wildcard jobs keep their current restore behavior and I'm fine without an upgrade note for this option. I'll re-check the option declaration and the doc row on the next push and mark F3 resolved then.
**F1 / F8** — The test plan sounds right: backtick and `;` cases in `MySqlSchemaTest`, plus a deserializer-level test asserting that a name failing validation produces no `CreateTableEvent` and never reaches the sink. Please also make the WARN-and-skip behavior for all-numeric names explicit in the doc alongside the identifier shape, so operators understand why such a table is not picked up rather than seeing it as a silent omission.
**F2, F4, F5, F6, F7** — Understood these are still pending. For the next push I'm specifically looking for:
- F2: Javadoc on both `supportsNewlyCreatedTable` declarations stating that a runtime `CreateTableEvent` is never silently dropped and that the job fails when the sink has not opted in — and the dispatch code actually enforcing that.
- F4: strict routing/target-scope validation so a source-side CREATE TABLE can only produce DDL for the intended sink target.
- F5: a defined retry/idempotency behavior when runtime writer creation throws `IOException`, so a transient failure cannot orphan the new table while its rows keep flowing.
- F6: the restore test with an old-format `MultiTableState`.
- F7: the explicit `exactly_once = false` (and `generate_sink_sql = true`) constraints in both the en and zh JDBC sink docs.
**CI** — Noted that the two red groups on this head are reported as unrelated to this change. Please merge current `dev` with the next push as you proposed and share the outcome; if `all-connectors-it-2` or `engine-v2-it` still fail after that, let's look at whether there is any interaction before concluding they are pre-existing.
Ping me once the push is up and I'll do the full pass on the remaining items.
<!-- streview-comment:1791 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-5473713721
Update on this exact head (`9577677bb86c`, `2026-08-30`), two new commits since my last comment (`5459248432`, `2026-08-29T00:41:51Z`). Both are real code changes, so I re-traced them fully rather than trusting the commit messages.
# What Problem Does This PR Solve?
A MySQL CDC job using `database-pattern`/`table-pattern` (wildcards) previously could not pick up a table created after the job started. This PR adds `scan.binlog.newly-added-table.enabled` to convert a Debezium `CREATE TABLE` schema record into a `CreateTableEvent` in-flight, and gives `MultiTableSinkWriter`/`MultiTableSink` a way to create a per-table JDBC writer (and physical table) at runtime.
# 1. Code Change Review
## 1.1 Core Logic Analysis — this is the important part, so I'm being direct about it
**The feature's own E2E test now passes, and I traced exactly why.** `mysql-cdc-connector-it` is green on both JDK 8 (`99275592981`) and JDK 11 (`99275593075`) in this head's fork run (`33316056455`) — the first time in this PR's history that's been true. I did not take that at face value; I read the actual fix.
Commit `9577677bb86c` ("[Fix][Zeta] Forward runtime create table events") touches `SeaTunnelSourceCollector.java:279-297` in `seatunnel-engine-server`, and it is the real root cause of every prior failure I reported on this PR (including my `2026-08-20` finding that `CreateTableEvent` "never appears anywhere in the job log for this head", and the `2026-08-29` finding of a sink-side `Table ... doesn't exist` timeout). The chain is:
```
SeaTunnelRowDebeziumDeserializeSchema.handleTableChangeStruct() (connector-cdc-base, unchanged)
-> registers the new CatalogTable, logs "Registered newly added CDC table" (line 155)
-> emitPendingCreateTableEvents() calls collector.collect(createTableEvent) (line 317)
-> AT RUNTIME this collector is SeaTunnelSourceCollector (Zeta engine)
-> collect(SchemaChangeEvent event), rowType is MultipleRowType, tableId not yet
in rowTypeMap (true for every newly-added table by definition)
BEFORE this commit: log.warn("Ignore schema change event for unknown table..."), return
-> sendRecordToNext() is NEVER called, event dies here
AFTER this commit: if (event instanceof CreateTableEvent) seed rowTypeMap from
createTableEvent.getChangeAfter(), fall through to sendRecordToNext()
```
So the connector-side logging was correct the whole time ("Registered newly added CDC table" firing was real progress, as I said on 08-29) — the event was being built and handed to the engine correctly, then silently dropped one layer up, inside the Zeta engine's own collector, before it could ever reach `MultiTableSinkWriter.applySchemaChangeEvent()` or trigger a save-mode table creation. That fully explains why the sink-side table was never created within the 2-minute Awaitility window: the sink never received the event in the first place. This was a real engine-level bug, not a connector-level one, and not something the connector-side fixes in `82165d5d18a1` could have addressed on their own.
The new unit test (`SeaTunnelSourceCollectorSchemaChangeTest.shouldForwardCreateTableEventForUnknownTableInMultipleRowType`) directly exercises this: `collect(CreateTableEvent)` for an unknown table followed by `collect(row)` for that same table, asserting `output.received()` fires twice. I checked it against a real `SeaTunnelSourceCollector` (not a partial mock of the method under test), and it fails against the pre-fix code path (the event would never reach `sendRecordToNext`). This is the right regression test for this bug.
Commit `496a3253694c` ("[Fix][API] Copy primary key columns for serialization") is a second, independent fix in the same problem space, this time for the Flink engine: `PrimaryKey`'s constructor previously aliased the caller-supplied `columnNames` list directly. When an immutable/unmodifiable list is passed in — which happens along the CDC schema-conversion path — Flink's Kryo serializer attempts to populate that list in place during (de)serialization and throws. The fix defensively copies into a new `ArrayList`. `PrimaryKeyTest.copiesImmutableColumnNames` proves both the copy-on-construct behavior and that mutations to the primary key's own list don't leak back into the caller's list. Correctly scoped, and the 2-arg legacy constructor is preserved by delegation, so no observable behavior change for existing callers passing mutable lists.
**Both fixes are genuine, targeted, and test-backed. I'm not going to relitigate my own past over-optimistic and then over-corrected readings on this PR (08-18, 08-19) — I looked at the actual before/after source and the actual current CI job logs for this exact head, not the commit message, before writing this.**
## 1.2 Compatibility Impact
Fully compatible. `SeaTunnelSourceCollector`'s new branch only activates for `event instanceof CreateTableEvent` with a `tableId` not already in `rowTypeMap` — a case that, absent this PR's own `scan.binlog.newly-added-table.enabled` feature, should not occur for any pre-existing job (any table a pre-existing job knows about is already seeded into `rowTypeMap` before the first event for it arrives). No existing schema-change handling path is touched; the `else` branch for known tables and the fallback `log.warn(...)`+`return` for any other unknown-table event type are byte-for-byte unchanged. The `PrimaryKey` change is a pure internal-representation fix (copy vs. alias) with the legacy 2-arg constructor preserved.
## 1.3 Performance / Side-Effect Analysis
Negligible. One `instanceof` check plus one `HashMap.put` per newly-discovered table (not per row), and one `ArrayList` allocation per `PrimaryKey` construction (already happens once per table/schema-change event, not per row).
## 1.4 Error Handling and Logging
Carrying forward, unresolved, from my `2026-08-28` review (`5050333217`) — neither of this round's two commits touches either of these:
**Issue 1 (carried over, unresolved, High): uncaught `IllegalArgumentException` from runtime identifier validation crashes the source reader instead of skipping the offending table**
- Location: `MySqlCatalogTableUtils.java:109` (`validateIdentifier`), reached with no surrounding try/catch from `handleTableChangeStruct` (`SeaTunnelRowDebeziumDeserializeSchema.java:127-153`).
- I re-checked this against the current head: `handleTableChangeStruct` still calls `tableChangeCatalogTableConverter.convert(tableChange)` directly inside the `tableChanges.forEach` lambda, no try/catch anywhere in that call chain.
- Risk unchanged: a source-DB principal with only `CREATE TABLE` privilege on a table matching the capture pattern can crash the whole running job by creating one table/column whose name fails identifier validation — under this feature's own enabled path.
- Severity: High.
**Issue 2 (carried over, unresolved, High): `hasSourceMatchedWriter` accepts every `CreateTableEvent` whenever a runtime factory exists, with no per-sink capability gate on Zeta**
- Location: `MultiTableSinkWriter.java:506-508` — `if (runtimeSinkWriterFactory != null) { return true; }` still runs unconditionally before the `supportsNewlyCreatedTable()` check just below it, and I confirmed `runtimeSinkWriterFactory` is non-null for every `MultiTableSink` instance.
- On the Zeta engine there is still no upstream `supports()`/`SchemaChangeType` gate before this, unlike Flink's `SchemaOperator`. This still contradicts the PR's own documented JDBC-only scope.
- Severity: High.
Both are exactly as I described them on 08-28/08-29; I'm not adding new instances of these, just confirming they're still live at the current head.
# 2. Code Quality Assessment
## 2.1 Coding Standards
Both new commits are cleanly scoped (one production file + one test file each), have doc comments explaining the *why* (not just what) at the exact lines that need it, and match the surrounding code style.
## 2.2 Test Coverage and Test Stability
- `SeaTunnelSourceCollectorSchemaChangeTest.shouldForwardCreateTableEventForUnknownTableInMultipleRowType` and `PrimaryKeyTest.copiesImmutableColumnNames` are both deterministic, single-threaded, no `Thread.sleep`, no shared static state, no timing dependency. Stable.
- The E2E level: `mysql-cdc-connector-it` passing 2/2 (JDK 8 + JDK 11) on this head is real signal, but it's one run. I'm not calling this "proven stable" off a single green run given this test's specific history of flipping between failure modes on this PR; I'd want to see it stay green through at least one more CI cycle (e.g. after the two Issues above are fixed) before calling the E2E coverage solid.
## 2.3 Documentation Updates
No doc changes in either of this round's two commits, and none were needed — neither touches user-facing config or contract surface.
# 3. Architectural Soundness
## 3.1 / 3.2 / 3.3
No change from my `08-28` assessment: the design direction (binlog-driven discovery over restart-based re-snapshot) is sound, and the dead `SupportMultiTableSinkWriter#createSinkWriter` SPI question (Issue 4, Medium, carried over unchanged) is still the main maintainability wart.
## 3.4 Historical-Version Compatibility
Both new fields/behaviors are new to this unmerged PR, so there is no released-version checkpoint/restore compatibility surface being touched by either of this round's commits.
# 4. Issue Summary
| # | Issue | Location | Severity | Status |
|---|---|---|---|---|
| 1 | Identifier-validation `IllegalArgumentException` crashes job instead of skipping the table | `MySqlCatalogTableUtils.java:109` | High | Open, unchanged |
| 2 | `hasSourceMatchedWriter` skips the sink-capability gate on Zeta | `MultiTableSinkWriter.java:506-508` | High | Open, unchanged |
| 3 | `SeaTunnelSourceCollector` silently dropped `CreateTableEvent` for unknown tables | `SeaTunnelSourceCollector.java:279-297` | High | **Fixed this round, verified** |
| 4 | `SupportMultiTableSinkWriter#createSinkWriter` SPI still dead code, not deprecated | `SupportMultiTableSinkWriter.java` | Medium | Open, unchanged |
| 5 | No unit test exercises `MultiTableSink`'s real `FactoryUtil`-based runtime path | `MultiTableSinkWriterTest.java` | Medium | Open, unchanged |
| 6 | Docs describe a JDBC-only scope not enforced in code (same root cause as #2) | `docs/en/connectors/source/MySQL-CDC.md` | Medium | Open, unchanged |
# 5. Merge Recommendation
**Not recommended for merge yet — but this is genuine, verified progress, not a repeat of my prior status quo.** The headline capability (a newly-created wildcard table gets discovered from binlog and picked up end-to-end without a job restart) now actually completes in CI for the first time in this PR's history, and I traced the fix to a real, previously-misdiagnosed-by-me engine bug rather than accepting the commit message. That said, two High-severity issues from my last round (Issues 1 and 2 above) are untouched by this round's commits and remain the reason I'm not calling this ready: one is an availability bug reachable by the same low-privileged source actor the feature's own identifier-validation hardening was meant to constrain, the other means the runtime-writer path silently applies to sink types the docs say it shouldn't, on the primary engine.
Also flagging for transparency since I'm the author here and this carries no approval weight either way: this PR is `diverged` from `dev` (`ahead_by=21`, `behind_by=89`) and still in draft. CI on this head has exactly one unrelated failure (`PostgresCDCIT.testPostgresCdcSnapshotOnlyAndCommittedOffsetStartupModes`, a `ConditionTimeout` on JDK 8 only, passing on JDK 11 in the same run — consistent with known pre-existing Postgres CDC E2E flakiness, not this PR's diff) and one unrelated cancellation (`paimon-connector-it`, a known pre-existing classloader-hang timeout, also not this PR's diff). Neither blocks the conclusion above; the real blockers are Issues 1 and 2.
As before, this is a plain comment rather than a formal review since GitHub does not allow self-approval on this PR; it carries no approval weight, and a maintainer with write access still needs to do the actual review/merge step once Issues 1 and 2 are 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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7037909254
Thanks, @SEZ9. I agree with keeping the existing end-to-end contracts together: new-table discovery must reach the Zeta produced-type path; sink capability/configuration rejection must precede writer/save-mode/quarantine side effects; retries under the schema barrier must not indefinitely stall all tables; and drop/recreate handling must not ignore the replacement schema. The admission bound and engine-support/conflict documentation need to match the implemented scope.
Please address those existing blockers with the corresponding runtime-path regressions in a new commit. I have not re-reviewed or approved an unchanged implementation, and no proposed fix is considered delivered from discussion alone.
Checked unchanged head `531db9be494e7c6aca617b45d3f8972045e75513` against `dev`: compare `diverged`, ahead 38 / behind 43. This drift is recorded independently; it does not by itself request synchronization. This is a discussion/CI follow-up, not another full source review. No local build, test or runtime execution was performed. Daniel has READ repository permission; effective maintainer approval/dismissal remains a separate repository gate. Checked 2026-11-20T11:59:57.811808+00:00.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7130313053
Thanks, @SEZ9 — I agree with this status, and it is the same set retained in my complete review.
The source startup schema promotion and config-aware JDBC capability precheck are closed. The barrier-retry blocker is still real: MultiTableSinkWriter's schema barrier dispatch calls registerNewlyCreatedTable:763 and createRuntimeSinkWriter:831 while sibling workers remain parked. Retry delay at that boundary holds healthy tables/checkpoint progress as well as the failing table. Retry/admission work must become table-local without waiting through the retry window under the shared barrier.
The registered-path early return at 778 still treats re-CREATE as replay without proving the old and new schema are equivalent; DROP/re-CREATE with changed columns remains distinct from idempotent duplicate CREATE. Runtime-created writer/state admission also remains unbounded with no retirement contract. Those are the existing re-CREATE/admission findings, not new requirements.
Please complete the same EN/ZH option contract: relationship to schema-changes.enabled and forced Debezium include.schema.changes; startup rejection when table-names is configured; and the exact supported engine wiring. The current cancelled Build 45009815106 does not clear these blockers, and GitHub still reports dev merge conflicts that the author must resolve. I have not added any unrelated CI patch request.
This is a discussion follow-up on unchanged head `34d388c9150d5bbf83591bbf1e3e3a930e342342`, not a new full source review. I inspected the named local source paths; no local build, test or SeaTunnel runtime was executed. Daniel has READ permission; effective maintainer approval and historical review dismissal remain separate repository actions.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "davidzollo (via GitHub) via commits" <co...@seatunnel.apache.org>.
davidzollo commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7079009487
Thanks @SEZ9. The blocking items from the review have been addressed together in commits up to head `34d388c9150d5bbf83591bbf1e3e3a930e342342`:
1. **Single initial table on Zeta (PR11206-F2)**: Addressed in commit `df80cd4e0360` (`[Fix][Zeta] Register runtime CDC tables after single-table startup`). `SeaTunnelSourceCollector` now properly admits and registers `CreateTableEvent` runtime schema changes even when starting with a single matched table, propagating type updates to the plan.
2. **JDBC capability check**: Addressed in commit `34d388c9150d` (`[Fix][Connector-V2] Reject unsupported runtime JDBC table options before opening writers`). `JdbcSinkFactory` validates and rejects unsupported table-level options prior to writer initialization and save-mode side effects.
3. **Catalog & Startup Options**: Addressed in commit `ad4d43deff1c` (`[Fix][Connector-V2] Preserve MySQL catalog for runtime CDC table admission`) and commit `56644bda06a8` (`[Test][Connector-V2] Supply real startup options when restoring MySQL CDC`).
Fork Build run [45009815106](https://github.com/DanielLeens/seatunnel/actions/runs/45009815106) is dispatched on this head. Ready for re-review.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-5459248432
Correcting a stale CI fact from my review a few minutes ago: I said `mysql-cdc-connector-it` was "still running and hasn't produced a result yet" on this head. That run (`33139046600`) has since completed, and `mysql-cdc-connector-it` finished `failure` on both JDK 8 and JDK 11.
I pulled the raw job logs rather than trusting the check name alone, because this test's failure mode has changed meaningfully from earlier rounds and it deserves a precise read rather than a generic "still red" note:
- Source-side registration now works. Across every Flink minor version in the matrix (1.13/1.15/1.18/1.20), the log shows `Registered newly added CDC table source.payments_rt_<suffix>` firing right after the `ALTER TABLE` that adds the watched table -- this is real progress over the historical failure mode where that line never appeared at all.
- The job still fails, but later and differently: `AbstractMysqlCDCITBase.queryNewlyAddedWildcardSinkTable` hits `java.sql.SQLSyntaxErrorException: Table 'sink.source_payments_rt_<suffix>' doesn't exist`, and the Awaitility wait for that table to become readable times out at 2 minutes. This reproduces identically on both JDK 8 and JDK 11, across all four Flink versions the job matrix runs. So this is not flaky/intermittent -- the sink-side table for a newly-discovered wildcard table is not getting created within the wait window, every time.
Given that pattern, this is a genuine, still-open feature gap (the sink-side auto-create/schema-save-mode path for a newly added table isn't completing in time, or isn't being triggered at all), not CI noise -- so it does not change my Merge Recommendation. It's an addition to my existing blockers list, not a replacement: Issues 1 and 2 (High) from my review a few minutes ago -- runtime identifier validation failing open, and the missing sink-capability gate before runtime factory discovery -- remain the primary blockers on this head regardless of this CI result.
(The other three failing jobs on this run -- `unit-test (11, windows-latest)` and `all-connectors-it-7` on both JDKs -- I have not dug into yet; flagging that I haven't confirmed those are unrelated so it's not misread as a clean bill of health on the rest of the run.)
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6183874493
Thanks for the detailed per-finding status at `9007896511517e4b874142cfe704102861bbc444`. Notes from my side; I'll verify each point against the diff once the next push is up.
**F1 / F8 (identifier validation)** — Your description of `MySqlCatalogTableUtils.toRuntimeCatalogTable` → `validateRuntimeTableIdentifiers` as the single validation boundary, using the `[A-Za-z0-9_$]*[A-Za-z_$][A-Za-z0-9_$]*` pattern, sounds like the right direction. Two asks:
- Since the guarantee rests on one boundary, please add a unit test asserting that a `CreateTableEvent` whose identifier contains e.g. a backtick or `;` is skipped and never reaches the sink, so the invariant can't silently regress if another converter is wired in later.
- Please make sure the MySQL-CDC source doc describes the pattern actually enforced in code, including that all-numeric names are rejected and skipped with a WARN.
**F2 (fail-fast contract)** — Thanks for confirming the Javadoc update is coming. Please state explicitly on both `SupportMultiTableSinkWriter#supportsNewlyCreatedTable` and `TableSinkFactory#supportsNewlyCreatedTable` that a runtime `CreateTableEvent` is never silently dropped and that the job fails when the sink has not opted in.
**F3 (`scan.newly-added-table.enabled` default)** — Not covered in your reply. Could you say whether you intend to keep the default as `true`? If so, please add an upgrade note to the MySQL-CDC docs describing the changed checkpoint-restore behavior for existing wildcard jobs; otherwise flip the default to `false`.
**F7 (JDBC sink docs)** — Thanks; making `exactly_once = false` explicit alongside `generate_sink_sql = true` in both the en and zh JDBC sink docs sounds good.
**F4 / F5 / F6** — Understood these are still open. For F6, please include a test that restores an old-format `MultiTableState` (without runtime-registered tables) so rollback/restore behavior is covered, not just documented.
Since compilation and tests weren't run for this update, please ping once the next push is up and the suite has been exercised locally, and I'll do another pass.
<!-- streview-comment:1773 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-5343036309
# What Problem Does This PR Solve?
**User pain point:** a MySQL CDC job configured with `table-pattern`/`database-pattern` cannot pick up a table created *after* the job starts. Debezium matches the new table's row events against the pattern at the source level, but SeaTunnel's reader never registers a schema/converter for it, so the rows are silently dropped, and the JDBC sink has no mechanism to create the corresponding target table on the fly.
**Fix approach:** the PR adds `scan.newly-added-table.enabled` (formalizes the pre-existing restore-time re-snapshot behavior, default `true`, no behavior change) and `scan.binlog.newly-added-table.enabled` (new, default `false`) — the latter is meant to parse the `CREATE TABLE` entry out of Debezium's `tableChanges` while the reader is already streaming binlog, build a `CatalogTable`, and emit a `CreateTableEvent`. On the sink side it adds `SupportMultiTableSinkWriter#createSinkWriter` and a `RuntimeSinkWriterFactory` hook so `MultiTableSinkWriter` can spin up a brand-new per-table JDBC writer at runtime and physically create the target table via `catalog.createTable(...)`.
**One-sentence summary:** the design direction is sound and the SeaTunnel-side wiring I re-traced this round is structurally correct, but I pulled the raw job log from this exact head's own CI run and found hard, direct evidence that the headline capability has never once completed end-to-end in any of the 10 executions of its own e2e test — this is a stronger finding than what earlier rounds on this PR reported, and it corrects an over-optimistic claim from my own previous round.
---
## Important correction to my own previous round (2026-08-18)
My last review on this exact head (`60d4e4155519`, unchanged since) stated: *"the normal streaming path does reach `handleTableChangeStruct`... the mechanism is now proven to reach the sink and materialize the table on every single one of 10 CI executions I inspected."* I went back to the actual CI job log for this same run this round (`mysql-cdc-connector-it (8, ubuntu-latest)`, run `32043314641`, job `95426735095`, https://github.com/DanielLeens/seatunnel/actions/runs/32043314641/job/95426735095) and that claim does not hold up:
- `grep -c "Registered newly added CDC table"` (the exact success log at `SeaTunnelRowDebeziumDeserializeSchema.java:152`, emitted only when `handleTableChangeStruct` actually registers a new table) against the full 233,089-line job log → **0 matches**, across all 10 test executions in the run.
- `grep -c "Registered runtime sink writer for newly created table"` (the sink-side success log at `MultiTableSinkWriter.java:751-753`) → **0 matches**.
- `grep -c "CreateTableEvent"` anywhere in the log (class name, in any stack trace or log line) → **0 matches**.
- Every one of the 10 executions of `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` (5 on `Mysql8_4CDCIT`, 5 on `MysqlCDCIT`, across engines) fails identically: `org.awaitility.core.ConditionTimeoutException: ... newly added wildcard sink table not readable yet: java.sql.SQLSyntaxErrorException: Table 'sink.source_payments' doesn't exist within 2 minutes`, with the whole test consistently costing 152-160s (i.e. exactly the 120s `awaitility` budget plus fixed setup overhead — not the tens-of-minutes-then-succeeds pattern I described last round).
- I did independently confirm the DML row for the new table *is* delivered to the reader: at `2026-08-17T20:43:48Z` the log shows a `READER_MESSAGE_DELAYED` event for `ConnectRecord{topic='mysql_binlog_source.source.payments', ... op=c, ...}` — Debezium is capturing binlog rows for the new table. But that is upstream of `deserialize()`/`shouldEmit()` filtering, not proof of successful registration, and the actual registration log never appears anywhere afterward.
I'm flagging this explicitly rather than quietly reissuing a corrected number, because it changes the merge-blocking finding from "works but too slow to demonstrate in CI" to "has never been observed to complete, in any execution, of its own test." I don't have a fully pinned root cause (see 1.1 below for what I did trace), but the empirical evidence is unambiguous, and it reconfirms — not refutes — the original concern raised earlier in this PR's history that the source-side registration ("Registered newly added CDC table") never fires on the real streaming path.
---
# 1. Code Change Review
## 1.1 Core Logic Analysis
**Files re-traced this round:** `SeaTunnelRowDebeziumDeserializeSchema.java`, `AbstractDebeziumDeserializationSchema.java`, `MySqlIncrementalSource.java`, `MySqlSourceConfigFactory.java`, `IncrementalSourceStreamFetcher.java` (source side, unmodified by this PR but on the critical path), `MultiTableSinkWriter.java`, `MultiTableSink.java` (sink side).
**What I verified is correctly wired (source-level, not just CI-observed):**
```java
// SeaTunnelRowDebeziumDeserializeSchema.java:126-154
protected void handleTableChangeStruct(Struct tableChangeStruct) {
if (!scanBinlogNewlyAddedTableEnabled || tableChangeCatalogTableConverter == null) {
return;
}
...
tables.add(catalogTable);
pendingCreateTables.add(catalogTable);
tableRowConverters = createTableRowConverters(...);
log.info("Registered newly added CDC table {}", catalogTable.getTablePath());
}
```
- `MySqlIncrementalSource.java:284-292` wires both `scanBinlogNewlyAddedTableEnabled` (from `SCAN_BINLOG_NEWLY_ADDED_TABLE_ENABLED`) and `tableChangeCatalogTableConverter` (a real `MySqlCatalogTableUtils.toCatalogTable(...)` lambda, not null) into the builder, so the early-return guard should not trip when the option is on.
- `MySqlSourceConfigFactory.java:105-107` sets Debezium's `include.schema.changes=true` whenever `scanBinlogNewlyAddedTableEnabled` is set, which is what's supposed to make Debezium emit `TABLE_CHANGES`-bearing history records for DDL encountered on the binlog.
- `AbstractDebeziumDeserializationSchema.java:65-77`'s `deserialize()` unconditionally calls `handleTableChangeStruct` for every record where `isSchemaChangeEvent(record)` is true, and `SeaTunnelRowDebeziumDeserializeSchema.deserialize()` calls `super.deserialize(...)` first (`:169`) — so there's no dead branch *inside this class*.
- `IncrementalSourceStreamFetcher.shouldEmit(...)` (`:265-294`, unmodified by this PR) returns `true` unconditionally for any record that is *not* a data-change record (`:293-294`), i.e. schema-change/DDL records are not filtered out by table-membership here. So the DDL-suppression, if it exists, is not in this filter.
- The e2e conf (`mysqlcdc_wildcards_with_newly_added_table.conf`) sets both `schema-changes.enabled=true` and `scan.binlog.newly-added-table.enabled=true`, and `table-pattern="source.*\\..*"` does match `source.payments`.
**What actually happens in CI (the part that matters):** despite all of the above being wired correctly at the layer I can read statically, the success log at the end of `handleTableChangeStruct` never fires. The most likely remaining candidates are further upstream than this PR's diff — in how the custom `EmbeddedDatabaseHistory` (used at `MySqlSourceConfigFactory.java:94`, not part of this diff) interacts with Debezium's actual DDL-to-history-record emission for a table `CREATE`d after the connector has already left the snapshot phase, or in the per-table watermark bookkeeping in `IncrementalSourceStreamFetcher`'s data-record path swallowing the record before a schema-change record is ever produced for it. I was not able to fully pin this down through static reading in the time available; I flag it as the concrete next investigation step rather than guessing further.
**Key findings:**
1. The SeaTunnel-side wiring for this feature (config plumbing, builder wiring, event dispatch, filter pass-through) is structurally sound wherever I could verify it directly.
2. Despite that, the feature's success path has literally never been observed to fire in any of the 10 executions of its own e2e test in the current CI run for this exact head.
3. This is not a defensive fix or workaround — it is meant to be the PR's headline capability — and it is currently inert on the one path that's supposed to prove it: the job's own binlog-streaming e2e test.
4. Because the failure is 10/10 reproducible with an identical error and identical timing envelope, this reads as a deterministic gap, not CI flakiness or a slow-but-working mechanism.
**Runtime path (intended, per source; the point marked ✗ is where CI evidence says it actually stops)**
```text
Binlog streaming phase (scan.binlog.newly-added-table.enabled = true)
-> Debezium/EmbeddedDatabaseHistory should deliver a schema-change record for "CREATE TABLE source.payments"
-> IncrementalSourceStreamFetcher.shouldEmit(record) -> true (non-data-change records pass through) [:293-294]
-> AbstractDebeziumDeserializationSchema.deserialize() [:65-77]
-> handleTableChangeStruct(tableChangeStruct) [SeaTunnelRowDebeziumDeserializeSchema.java:127-154]
-> log.info("Registered newly added CDC table {}", ...) ✗ NEVER OBSERVED IN CI (0/233089 log lines)
-> emitPendingCreateTableEvents(...) -> CreateTableEvent ✗ never observed (0 matches for "CreateTableEvent" anywhere in the log)
Sink side (MultiTableSinkWriter.registerNewlyCreatedTable) ✗ never reached (0 matches for its success log)
Test assertion
-> queryNewlyAddedWildcardSinkTable() polls "sink.source_payments" for 120s
-> ConditionTimeoutException every time: "Table 'sink.source_payments' doesn't exist" (10/10 executions, ~153-160s each)
```
## 1.2 Compatibility Impact
**Partially incompatible.**
- `scan.binlog.newly-added-table.enabled` defaults to `false` — no behavior change for existing jobs that don't opt in.
- `scan.newly-added-table.enabled` defaults to `true` and formalizes the pre-existing restore-time re-snapshot behavior — no behavior change.
- Checkpoint/state structure is unchanged; old checkpoints remain structurally loadable.
- One real, always-on compatibility change: `MultiTableSink.registerAggregatedFlush(...)` is now invoked unconditionally from both `createWriter` (`MultiTableSink.java:174`) and `restoreWriter` (`:245`) for *every* `MultiTableSink`, not just jobs using this new feature — see Issue 5 below.
## 1.3 Performance / Side-Effect Analysis
- `MultiTableSinkWriter.registerNewlyCreatedTable` (`:683-757`) holds `synchronized (runnable.get(i))` (`:691`) across the entire per-queue writer creation, including `runtimeSinkWriterFactory.create(catalogTable, context)` (`:713`), which for JDBC ends in a live `catalog.createTable(...)` DDL round-trip in `AbstractJdbcSinkWriter`. This is a lock held across blocking I/O; under `multi_table_sink_replica > 1` or high per-queue contention this serializes registration and is a real, if currently unobserved-in-passing-CI, latency/contention risk. I re-confirmed this pattern is unchanged this round.
- `tableRowConverters` is rebuilt for the *entire* `tables` list every time a single new table is registered (`SeaTunnelRowDebeziumDeserializeSchema.java:146-151`) — O(all known tables) per discovery event, not O(1).
- No upper bound on the number of runtime-registered tables; a broad `table-pattern` combined with `scan.binlog.newly-added-table.enabled=true` can accumulate sink writers without limit.
## 1.4 Error Handling and Logging
**Issue 1: The feature's own success path has never been observed to fire in CI; its e2e test fails deterministically, not intermittently**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:152` (never-logged success line); `MultiTableSinkWriter.java:751-753` (never-logged sink-side success line); test at `seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e/src/test/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/AbstractMysqlCDCITBase.java:845-881`
- **Problem description:** In the current head's own CI run (`mysql-cdc-connector-it (8, ubuntu-latest)`, https://github.com/DanielLeens/seatunnel/actions/runs/32043314641/job/95426735095), `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` fails all 10/10 times it runs (5 container variants x 2 engine test classes) with the identical error `Table 'sink.source_payments' doesn't exist within 2 minutes`, each execution costing ~153-160s (bounded by the 120s `await()` plus fixed overhead — not a slow-but-eventually-successful pattern). Neither of the two success log lines that would prove the mechanism worked appear anywhere in the 233k-line job log, and the string `CreateTableEvent` does not appear anywhere either (not even in a stack trace). I did confirm Debezium *is* delivering DML for the new table to the reader (a `READER_MESSAGE_DELAYED` event for `source.payments` row `id=2001` at `20:43:48Z`), so the gap is specifically in the DDL/schema-change registration path, not in bi
nlog delivery generally.
- **Potential risk:** the PR's headline capability — binlog-driven newly-added-table discovery — does not currently work at all on the one path built to demonstrate it. Merging this as-is ships a documented, opt-in feature (`docs/en/connectors/source/MySQL-CDC.md`'s new "Newly Added Tables" section) that a user who enables it will find silently does nothing: rows for the new table are captured by Debezium but permanently dropped (`SeaTunnelRowDebeziumDeserializeSchema.java:328-331`, at `log.debug`, so effectively invisible operationally) because the table's converter and the sink's writer are never registered.
- **Best improvement:** before this can be considered for merge, get `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` passing against a real run and confirm the "Registered newly added CDC table" log actually appears. The most productive place to continue tracing is upstream of this PR's diff: how `EmbeddedDatabaseHistory` (`MySqlSourceConfigFactory.java:94`) surfaces DDL processed after the connector has already left the snapshot phase, and whether a schema-change `SourceRecord` is actually produced/queued for `CREATE TABLE source.payments` at all before it ever reaches `AbstractDebeziumDeserializationSchema.deserialize()`.
- **Severity:** High (Blocker)
- **Raised by another reviewer:** No — this specific "never fires in CI, not just slow" framing is new evidence from this round; it corrects a more optimistic characterization from my own 2026-08-18 comment on this same PR, which I'm superseding here.
**Issue 2 — A binlog-registered table is not checkpointed and would be silently forgotten after any restart**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:121-124`,`:144-152` (`tables`/`tableRowConverters` are plain mutable fields, no checkpoint-state hook); `MultiTableSink.java:199-230` (`restoreWriter` iterates only `sinks.keySet()`, the config-time table set — re-verified this round by direct read)
- **Problem description:** `restoreWriter` never sees a table registered purely at runtime via `registerNewlyCreatedTable`, because that registration only mutates in-memory maps on the live `MultiTableSinkWriter` instance and is never folded into `MultiTableState`.
- **Potential risk:** would be silent, permanent data loss for exactly the tables this feature exists to capture, on the next restart — a routine event for a long-running CDC job. (This is currently unobservable in practice only because Issue 1 means the table is never successfully registered in the first place; it becomes a live risk the moment Issue 1 is fixed.)
- **Best improvement:** persist the set of runtime-registered `CatalogTable`s/`TablePath`s into checkpoint state so restore can re-run the equivalent of `registerNewlyCreatedTable` on recovery.
- **Severity:** High
- **Raised by another reviewer:** No.
**Issue 3 — No capture-pattern check before registering a table discovered from binlog DDL**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:127-154` (re-verified: `handleTableChangeStruct` only checks `containsTable` for dedup, never re-checks the new table's path against `table.include.list`/`table-pattern`)
- **Problem description:** every `TableChangeType.CREATE` observed is registered unconditionally, with no filter against the configured capture pattern.
- **Potential risk:** directly contradicts this PR's own new documentation (`docs/en/connectors/source/MySQL-CDC.md`: "The new table must match the configured capture pattern") — the doc makes a scoping promise the code does not enforce. A job capturing `orders_.*` could start registering `audit_log` the moment it's created in the same database.
- **Best improvement:** apply the same table-filter logic the connector already uses elsewhere inside `handleTableChangeStruct` before `tables.add(catalogTable)`.
- **Severity:** High
- **Raised by another reviewer:** No.
**Issue 4 — `CreateTableEvent` bypasses `schemaChangeEventFilter`**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:194-196` (`emitPendingCreateTableEvents` returns `true`, short-circuiting before the filter) vs. `:213-215` (the filter every other schema-change event goes through) — re-verified by direct read this round.
- **Problem description:** every other schema-change event is passed through `schemaChangeEventFilter.filter(...)` before being collected; `CreateTableEvent`s are not.
- **Potential risk:** a user who excludes schema changes via `schema-changes.exclude` would still receive `CreateTableEvent`s for newly discovered tables — inconsistent with the rest of the same job's configuration.
- **Best improvement:** route the emitted `CreateTableEvent` through `schemaChangeEventFilter` before `collector.collect(...)`, same as the rest of the method.
- **Severity:** Medium-High
- **Raised by another reviewer:** No.
**Issue 5 — Aggregated flush is now registered unconditionally for every multi-table sink job, not just this feature's users**
- **Location:** `MultiTableSink.java:174` (`createWriter`), `:245` (`restoreWriter`), both calling `registerAggregatedFlush(context, writer)` (`:291-293`) — re-verified by direct read this round.
- **Problem description:** every `MultiTableSink`, including jobs that never touch `scan.binlog.newly-added-table.enabled`, now registers this new flush action on upgrade.
- **Potential risk:** a runtime-behavior change for existing production multi-table-sink jobs outside the opt-in envelope the rest of this PR otherwise maintains.
- **Best improvement:** gate `registerAggregatedFlush` behind whether `runtimeSinkWriterFactory` is non-null, rather than calling it unconditionally.
- **Severity:** Medium
- **Raised by another reviewer:** No.
**Issue 6 — Single-table jobs bypass the unknown-table guard entirely**
- **Location:** `SeaTunnelRowDebeziumDeserializeSchema.java:317-335`, the `else` branch at `:333-335` — re-verified by direct read this round.
- **Problem description:** the `tables.size() > 1` guard that protects against forwarding rows for an unregistered table only applies to the multi-table branch; the single-table `else` branch unconditionally uses `DEFAULT_TABLE_NAME_KEY`.
- **Potential risk:** low today (a single-table job has no meaningful newly-added-table scenario), but an inconsistency that would surface if this code is reused for a job that starts single-table and later gains tables.
- **Best improvement:** apply the same `tableId`-keyed lookup in both branches, or document why the single-table path is exempt.
- **Severity:** Medium
- **Raised by another reviewer:** No.
**Issue 7 — Duplicated builder call, unfixed across multiple review rounds**
- **Location:** `MySqlIncrementalSource.java:282-283` — re-confirmed present, unchanged, this round.
- **Problem description:** `.setSchemaChangeEventFilter(SchemaChangeEventFilter.fromConfig(config))` appears twice in a row, identically.
- **Potential risk:** none functionally (idempotent), but a signal that small, easy review comments on this PR aren't being worked through.
- **Best improvement:** delete the duplicate line.
- **Severity:** Low
- **Raised by another reviewer:** No.
**Issue 8 — Silently no-ops in `table-names` mode, with no validation**
- **Location:** `MySqlSourceConfigFactory.java:133-136` (`table.include.list` set from the fixed `tableList` when `table-names` is used, not a pattern).
- **Problem description:** `scan.binlog.newly-added-table.enabled` is only meaningful when new tables can match a pattern; in `table-names` mode the include list is a fixed enumeration, so no table created after job start can ever match. There is no validation warning about this combination.
- **Best improvement:** reject or warn in the factory's option validation when `scan.binlog.newly-added-table.enabled=true` is combined with `table-names`.
- **Severity:** Medium
- **Raised by another reviewer:** No.
No sensitive data is logged anywhere in the new code.
---
# 2. Code Quality Assessment
## 2.1 Coding Standards
Javadoc is present on new public/protected methods (`handleTableChangeStruct`, `registerNewlyCreatedTable`, `registerAggregatedFlush`, `isScanNewlyAddedTableEnabledOnRestore`, the new `Option`s), no wildcard imports, no `System.out.println`, ASF headers present on new files. The `containsTable` and `emitPendingCreateTableEvents` Javadocs are clear about *why*, not just *what*. Issue 7's duplicated line is the one concrete, trivial miss.
## 2.2 Test Coverage and Test Stability
**Stability rating: High risk.**
- `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` fails deterministically (10/10) at the current head — see Issue 1. Per the review protocol's rule, a test that cannot pass in CI must be rated High risk regardless of suspected root cause.
- The `Awaitility` polling itself is well-structured (`untilAsserted`, condition-based) and the most recent commit (`60d4e4155519`, "[Test][E2E] Retry newly-added wildcard sink polls...") correctly fixes a real bug where `query()`'s `SQLException`-wrapped-in-`RuntimeException` was aborting the poll on its first legitimate "table not created yet" hit instead of retrying — I confirmed this fix is syntactically correct and does not itself explain Issue 1 (the underlying table genuinely never gets created within the test's lifetime, retried or not).
- No new test restarts a job across the table-addition window (would exercise Issue 2), no negative test asserts a non-matching table is *not* registered (would catch Issue 3), no test for `schema-changes.exclude` interaction with `CreateTableEvent` (would catch Issue 4), no test for the `table-names` mode combination (would catch Issue 8). Only one new e2e conf (`mysqlcdc_wildcards_with_newly_added_table.conf`) exists, and it doesn't currently pass.
- No hard-coded ports, no shared static state, no order-dependent assertions observed in the new test code itself.
## 2.3 Documentation Updates
`docs/en/connectors/source/MySQL-CDC.md` and `docs/zh/connectors/source/MySQL-CDC.md` were both updated (8 lines each) with a new options table rows and a "Newly Added Tables" subsection. Problems:
- The doc's claim "The new table must match the configured capture pattern" is not enforced by the code (Issue 3).
- No mention that a runtime-discovered table is lost on restart (Issue 2).
- No mention of the `table-names` mode restriction (Issue 8).
- Most importantly right now: the documented behavior ("registers table metadata from the CREATE TABLE schema record and then reads following DML records for that table") does not match what the current CI run demonstrates (Issue 1).
---
# 3. Architectural Soundness
## 3.1 Elegance of the Solution
The binlog-ordering insight (MySQL cannot emit a row event for a table before its own `CREATE TABLE`, so there's no missed-event race on discovery ordering itself) is sound, and the base-class hook design (`handleTableChangeStruct` as an overridable no-op) is clean. But given Issue 1, this is currently best classified as an **incomplete implementation of a precise-fix design** — the architecture is right, the mechanism as implemented and shipped in this diff does not demonstrably work.
## 3.2 Maintainability
`handleTableChangeStruct`, `registerNewlyCreatedTable`, and `restoreWriter` each touch overlapping "what tables does this job know about" state through three different, uncoordinated data structures (`tables`/`tableRowConverters` on the source; `sinks`/`sinkWritersWithIndex` on the sink), none backed by checkpoint state for the runtime-added case. That's the root of Issue 2 and would benefit from a single source of truth before this is extended further.
## 3.3 Extensibility
The `RuntimeSinkWriterFactory`/`SupportMultiTableSinkWriter#createSinkWriter` pattern is a reasonable, reusable extension point for other sink connectors to support runtime table creation in the future, independent of whether the source-side mechanism above is fixed.
## 3.4 Historical-Version Compatibility
No checkpoint/state schema change, no serialization format change for existing checkpoints. Issue 5 (unconditional aggregated-flush registration) is the one behavior change affecting existing jobs on upgrade.
---
# 4. Issue Summary
| # | Issue | Location | Severity |
|---|---|---|---|
| 1 | Feature's own e2e test fails deterministically (10/10) at current head; success logs on both source and sink side never appear in CI | `AbstractMysqlCDCITBase.java:845-881`; `SeaTunnelRowDebeziumDeserializeSchema.java:152`; `MultiTableSinkWriter.java:751-753` | High (Blocker) |
| 2 | Binlog-registered table not checkpointed; would be silently forgotten after restart | `SeaTunnelRowDebeziumDeserializeSchema.java:121-152`; `MultiTableSink.java:199-230` | High |
| 3 | No capture-pattern check before registering a DDL-discovered table; contradicts PR's own docs | `SeaTunnelRowDebeziumDeserializeSchema.java:127-154` | High |
| 4 | `CreateTableEvent` bypasses `schemaChangeEventFilter` | `SeaTunnelRowDebeziumDeserializeSchema.java:192-215` | Medium-High |
| 5 | Aggregated flush registered unconditionally for all multi-table sink jobs on upgrade | `MultiTableSink.java:174`, `:245`, `:291-293` | Medium |
| 6 | Single-table jobs bypass unknown-table guard | `SeaTunnelRowDebeziumDeserializeSchema.java:317-335` | Medium |
| 7 | Duplicated `.setSchemaChangeEventFilter(...)` call, unfixed across rounds | `MySqlIncrementalSource.java:282-283` | Low |
| 8 | Silently no-ops in `table-names` mode, no validation or doc note | `MySqlSourceConfigFactory.java:133-136` | Medium |
---
# 5. Merge Recommendation
### Conclusion: Not recommended for merge
**1. Blockers — must be fixed**
- **Issue 1** — the feature's own e2e test does not pass, and there is no CI evidence anywhere in the current run that the source-side registration (`"Registered newly added CDC table"`) or sink-side registration ever succeeds. This needs to be root-caused (see the "next investigation step" note in Issue 1) and demonstrated passing before this can move forward — not worked around with a longer timeout, since the current run shows no sign of eventual success either.
- **Issue 2** — no checkpoint persistence for runtime-registered tables; becomes a live silent-data-loss risk the moment Issue 1 is fixed.
- **Issue 3** — no capture-pattern filter on binlog-discovered tables, contradicting the PR's own documentation.
**2. Recommended fixes — non-blocking**
- Issue 4 (schema-change filter bypass), Issue 5 (unconditional aggregated-flush registration), Issue 6 (single-table guard inconsistency), Issue 8 (`table-names` no-op with no validation) — real but narrower in blast radius than the blockers above.
- Issue 7 (duplicated line) — trivial, easy to fold into the same pass.
**Overall assessment**
The design direction remains reasonable and the parts of the implementation I could verify statically (config plumbing, event dispatch, filter pass-through, the sink-side extension point) are wired correctly. But this round's contribution is a correction, not a reconfirmation: going back to the actual CI log for the exact current head rather than trusting my own prior notes, I found zero evidence — not "slow" evidence, zero evidence — that the mechanism this PR is meant to add has ever completed successfully. That's a more fundamental gap than "needs a longer test timeout," and it should be root-caused (I'd start by checking whether `EmbeddedDatabaseHistory` actually produces a schema-change `SourceRecord` for a table `CREATE`d after the connector leaves the snapshot phase — that's the one link in the chain I could not verify by reading source alone) and demonstrated with a genuinely passing e2e run before the durability (Issue 2) and scoping (Issue 3) gaps are worth investi
ng further review cycles in.
Because GitHub does not allow approving one's own pull request, this review is submitted as a plain comment rather than a formal review. It carries no approval weight, and merge still requires review and approval from another committer. The PR remains in **draft** state; GitHub currently reports `mergeStateStatus=DIRTY`/`mergeable=CONFLICTING` against `dev`, which will need to be resolved independently of the findings above. Separately from this feature's own test, this run also shows failures in `Dead links` (pre-existing/unrelated — it's reporting 404s for files that don't exist in `dev` itself, e.g. `docs/en/developer/new-license.md`, `plugin-mapping.properties`, unrelated to this PR's diff), `unit-test (windows-latest)`, `Dependency licenses`, `engine-k8s-it`, `transform-v2-it-part-1`, and `all-connectors-it-5`; I did not have time this round to individually root-cause each of those against `dev`, so I'm not asserting they're PR-caused, but they should be checked before this
is considered CI-green even after Issue 1 is fixed.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-5381413688
I pushed `0bc52ddf500` to the current PR head.
The failure was coming from the wildcard newly-added-table E2E using the fixed runtime table name `payments` / `source_payments`. In the failed run on August 20, 2026, the job submission path already saw `source.payments` before the runtime-create step, and the JDBC save-mode logs treated `sink.source_payments` as an existing table, which means this test was colliding with leaked state from another invocation instead of proving the newly-added-table path.
This update keeps the production code unchanged and isolates the test by generating a unique runtime wildcard table name for each invocation, then deriving the matching sink table name from that value. That keeps the assertion focused on a table that definitely did not exist when the job started.
Local proof in this branch is limited to formatting only, per the current SeaTunnel PR workflow:
- `./mvnw spotless:apply -pl seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e -am -nsu`
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6553353143
Thanks for the update on `d4faf1ea1aab8414aea81371c7c5112078f96739` (merge of `dev` `3ac2d1cec6a` plus the fix commit). I'll wait for run 41164176211 to finish before drawing conclusions from it.
On the `testRuntimeRegistrationFailurePolicy` root cause: the explanation is clear and I agree with the classification — the `[MULTI_TABLE_ISOLATED_FAILURE]` is the `CONTINUE_OTHER_TABLES` all-tables-isolated rule firing because the test started with an empty writer map, so it is neither the unsupported-sink case (F2) nor the retry/idempotency gap (F5). Starting the test with `db1.healthy` and asserting that the healthy table keeps writing while no row of the rejected table reaches a writer sounds like the right fix. One ask: please keep the transient `IOException` during runtime writer creation (F5) as a separate test case, so the retry/idempotency contract gets its own coverage rather than being inferred from the failure-policy test.
The remaining items from the previous review are not covered in this comment, so a short status per item would help me finish:
- **F1 (HIGH, identifier injection):** is validation/quoting of runtime-discovered database/table names now enforced in code on the generated sink SQL and the `${database_name}_${table_name}` template, or still documentation-only?
- **F2 (HIGH, unsupported sink):** what happens when a runtime `CreateTableEvent` reaches a sink that does not support newly created tables via `supportsNewlyCreatedTable()` — fail the job, or drop rows? Please define it on the interface and cover it with a test.
- **F3 (HIGH, default of `scan.newly-added-table.enabled`):** has the `true` default been reconsidered, or is there a rationale for changing checkpoint-restore behaviour of existing wildcard jobs on upgrade?
- **F4 (MEDIUM, sink-side DDL from source events):** where is the routing/target-scope check that prevents a source-side CREATE TABLE from creating tables outside the configured sink scope?
- **F6 (MEDIUM, `MultiTableState` format):** how do old checkpoints restore, and what happens on rollback with a checkpoint that already contains runtime-registered tables?
- **F7 (MEDIUM, docs):** the JDBC sink documentation still needs the `exactly_once = false` / `generate_sink_sql = true` constraints.
- **F8 (LOW, allowlist):** `[A-Za-z_][A-Za-z0-9_$]*` rejects legal MySQL table names starting with a digit — please either widen the pattern or document the limitation explicitly.
If any of these were handled in the fix commit, a short pointer per item is enough.
<!-- streview-comment:2198 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6888625262
Thanks for the update on `da13705e6b08fde27653138a4cb0183563c69726`. The lifecycle fix for the empty-wrapper case (registering the guarded parent action at construction so the engine error-handler wrapper isn't replaced later) sounds like the right shape, and good to see the two-replica regression plus the MySQL wildcard test running against two sink replicas.
A few things I still need to close out the earlier review points:
1. **Partial registration / quarantine (F5)** – Could you describe what the post-barrier quarantine does with rows for a table whose writer creation failed? Specifically: is creation retried, is it idempotent on retry, and can quarantined rows ever be silently dropped rather than failing the job or being replayed once the writer exists?
2. **Unsupported sink path (F2)** – With `supportsNewlyCreatedTable()` defaulting to `false`, what happens when a runtime `CreateTableEvent` reaches a sink that doesn't support it? I'd like that behavior stated in the interface contract and covered by a test, so we don't end up with silent row drops or a null-writer NPE in the multi-table dispatch.
3. **Checkpoint compatibility (F6)** – Since runtime-registered tables are now persisted in `MultiTableState`, please confirm how restore from a pre-change checkpoint behaves, and what happens on version rollback.
4. **Default of `scan.newly-added-table.enabled` (F3)** – Is there a reason to ship this as `true`? Changing restore semantics for existing wildcard MySQL CDC jobs on upgrade is something I'd rather have opt-in, or at least called out explicitly in the docs.
5. **Identifier handling (F1, F4, F8)** – Please confirm the identifier allowlist is enforced in code (not just documented) before names reach generated sink SQL / the `${database_name}_${table_name}` template, and that the sink only creates tables within the configured target scope. Also note the documented regex `[A-Za-z_][A-Za-z0-9_$]*` rejects legal MySQL names starting with a digit.
6. **JDBC sink docs (F7)** – The `exactly_once = false` / `generate_sink_sql = true` constraints still need to land in the JDBC sink documentation, not only in the MySQL-CDC source page.
Since no local functional tests were run, let's get the applicable GitHub CI running on this head and look at the results before another pass. Happy to re-review once the above is addressed.
<!-- streview-comment:2360 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7263991355
Thanks for the update. Here is where the previously reviewed points stand, based on the latest summary.
**Described as addressed, not yet confirmed**
- **PR11206-F2** (single-table startup on Zeta): the summary says the single startup schema is promoted when a new per-table schema is registered.
- **PR11206-F1** (JDBC capability): the summary says the config-aware factory capability check runs before the retry/barrier.
A summary alone isn't enough to close these two. Could you point to the change and a test that covers each?
**Still open**
- **PR11206-F5**: the summary still lists retrying while the barrier is parked as a blocker, so one failing new table can stall all tables and checkpoints for the whole retry window. Please either move the retry out of the parked section or release the barrier between attempts.
- **PR11206-F7**: a second `CREATE TABLE` for an already-registered path needs to be handled. After DROP and re-CREATE with a different schema, the converters and the sink schema should be refreshed, or the job should fail explicitly rather than keep the stale ones.
- **PR11206-F8**: runtime admission still needs an upper bound and a removal path, so that sink writers and checkpoint state cannot grow without limit.
**Status not stated**
The latest summary doesn't say where the three docs points stand. Could you confirm whether the MySQL-CDC docs now cover each of these?
- **PR11206-F9**: how the runtime option relates to `schema-changes.enabled`, and that it overrides a user-supplied `debezium { include.schema.changes }`.
- **PR11206-F10**: that `scan.binlog.newly-added-table.enabled` is rejected at startup when `table-names` is configured, in both the option row and the "Newly Added Tables" section.
- **PR11206-F11**: which engines support runtime table registration.
For F5, F7 and F8, a test covering each fix would make them much easier to close.
<!-- streview-comment:2733 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-5379306626
# What Problem Does This PR Solve?
- User pain: a MySQL CDC job configured with `database-pattern`/`table-pattern` (wildcards) previously required a full job restart to pick up a table created after the job started.
- Fix approach: two opt-in switches — `scan.newly-added-table.enabled` (restore-time diff against checkpointed tables, snapshot backfill for new matches) and `scan.binlog.newly-added-table.enabled` (turn the `CREATE TABLE` Debezium schema-change record into a `CreateTableEvent`, register the deserializer schema in-flight, and let `MultiTableSinkWriter` create a per-table JDBC writer at runtime).
- One-sentence summary: the overall design is sound and this feature is close, but the feature's own dedicated E2E test still fails deterministically on the current head, and there are unresolved restore/checkpoint gaps on both the source and sink side.
Housekeeping note, for transparency: nothing has changed source-wise since my last comment on this same head (`c97e8583e855`) — same commit, same diff, and `gh pr view 11206 --json headRefName,statusCheckRollup,updatedAt` confirms the head SHA and the failing `Build` check are unchanged. Rather than re-post the same conclusion verbatim, I re-derived the key evidence myself from scratch this round — pulled and grepped the actual CI log, re-read the actual source files line by line, and traced one additional path (`IncrementalSource`'s pre-PR restore behavior) that resolves an open question from the previous round. Below is the full review with that fresh evidence.
# 1. Code Change Review
## 1.1 Core Logic Analysis
**Independent re-verification of the primary blocker (E2E not passing).** I pulled the actual fork CI log myself for this exact head (`gh api repos/DanielLeens/seatunnel/actions/jobs/96389079475/logs`, job `mysql-cdc-connector-it (11, ubuntu-latest)`, ~250k lines) rather than trusting the earlier summary:
- `grep -c "Registered newly added CDC table" job96389079475.log` → `0`. That log line is emitted only on the success branch of `SeaTunnelRowDebeziumDeserializeSchema.handleTableChangeStruct()` (the exact method this PR adds to wire binlog-discovered `CREATE TABLE` records into the live deserializer), and it never fires once in the whole run.
- The test fails deterministically, at the same line, in every container variant I found in the log (`Mysql8_4CDCIT`, `MysqlCDCIT`, ...): `AbstractMysqlCDCITBase.java:868`, with `org.awaitility.core.ConditionTimeoutException: ... newly added wildcard sink table not readable yet: java.sql.SQLSyntaxErrorException: Table 'sink.source_payments' doesn't exist within 2 minutes.`
I also re-read the actual call chain myself to confirm the mechanism, not just the symptom:
```text
AbstractDebeziumDeserializationSchema.deserialize() [:65-78]
if isSchemaChangeEvent(record):
for each tableChangeStruct in record's TABLE_CHANGES field:
handleTableChangeStruct(tableChangeStruct) <- overridden hook
SeaTunnelRowDebeziumDeserializeSchema.handleTableChangeStruct() [:127-157]
if !scanBinlogNewlyAddedTableEnabled: return
for each CREATE-type tableChange:
catalogTable = tableChangeCatalogTableConverter.convert(tableChange) // null => filtered out
if catalogTable == null: return
if containsTable(...): return
tables.add(catalogTable); pendingCreateTables.add(catalogTable)
tableRowConverters = createTableRowConverters(...)
log.info("Registered newly added CDC table {}", ...) <- never observed in CI
```
Both `AbstractDebeziumDeserializationSchema.deserialize()` and `handleTableChangeStruct()` look internally correct on static reading, and `MySqlSourceConfigFactory.java:104-107` correctly forces `include.schema.changes=true` when `scanBinlogNewlyAddedTableEnabled` is set, so Debezium should be emitting schema-change records at all. Since the log line proves the method's success path never completes, the actual defect is upstream of this method — either the schema-change `SourceRecord` for a table that did not exist at snapshot time never reaches `deserialize()` for the binlog phase, or `isSchemaChangeEvent(record)` never classifies it as one. That is exactly consistent with my prior finding, now backed by a log I pulled and grepped myself rather than taking on faith. I'd suggest the next concrete debugging step is adding a temporary trace at the top of `AbstractDebeziumDeserializationSchema.deserialize()` to confirm whether the schema-change record for the runtime table arrives
there at all.
**New finding this round — resolves an open question from my last comment and partially corrects @SEZ9's Issue 4.** @SEZ9 flagged that `scan.newly-added-table.enabled` defaulting to `true` "appears to be new behavior introduced by this PR" and could silently trigger unplanned snapshot reads for existing jobs after upgrade. I diffed `IncrementalSource.java` against the pre-PR base (`f1a1a0abb`) myself to settle this:
```diff
- Set<TableId> newTables = Sets.difference(capturedTables, checkpointCapturedTables);
+ Set<TableId> newTables =
+ isScanNewlyAddedTableEnabledOnRestore()
+ ? Sets.difference(capturedTables, checkpointCapturedTables)
+ : Collections.emptySet();
```
The `Sets.difference(capturedTables, checkpointCapturedTables)` restore-time reconciliation was **already unconditional pre-PR code** — every restart of every CDC connector already re-diffed the freshly-discovered catalog against the checkpointed table set and folded new matches into the snapshot phase. This PR's only change here is wrapping that pre-existing behavior in a new `isScanNewlyAddedTableEnabledOnRestore()` guard that defaults to `true`, i.e. it makes an already-existing behavior *optionally disable-able* rather than introducing it. So on the specific mechanism @SEZ9 raised, the docs' claim ("This keeps the existing SeaTunnel restore behavior by default", `docs/en/connectors/source/MySQL-CDC.md:195`) is accurate, and I'd downgrade this from "silently changes behavior for existing jobs" to a documentation-clarity nit at most — worth a one-line callout in the option's description that this was already the connector's restore behavior, but not a compatibility blocker.
**Re-verified two other source-level claims by reading the code directly, not by re-quoting the prior round:**
- `EventType.java:22` — confirmed `SCHEMA_CHANGE_CREATE_TABLE` is the first enum constant, ahead of the eight pre-existing `SCHEMA_CHANGE_*` constants, so @SEZ9's Issue 2 is factually accurate about the code. On the *impact* claim, I independently traced one of the concrete serialization paths myself: `JobEventReportOperation.writeInternal/readInternal` (`seatunnel-engine/.../event/JobEventReportOperation.java:55-72`) serializes the `List<Event>` through a plain `java.io.ObjectOutputStream`/`ObjectInputStream` — per the JLS, default Java enum serialization writes the constant's *name*, not its ordinal, so this specific path is unaffected by the insertion position. I have not re-audited every connector or every serializer in `seatunnel-engine`, so I can't rule out an ordinal-sensitive path existing elsewhere, but on the evidence I could independently confirm, I agree with the prior round's downgrade of this from High to Low — insert-at-end is still the right defensive practic
e for enum evolution, just not a proven active bug today.
- `MultiTableSink.java` — confirmed the class does carry a new field, `private final ReadonlyConfig options;` (`:84`), plus the `FactoryUtil`/`TableSinkFactory`/`ConfigValidator` imports @SEZ9 cited. I did not trace whether `MultiTableSink` instances actually cross a `serialVersionUID`-sensitive restore boundary in Zeta's checkpoint path, so I can't independently confirm or refute the severity of @SEZ9's Issue 3 this round either — passing it through as open, same as last time.
## 1.2 Compatibility Impact
**Partially incompatible only within this feature's own new surface, fully compatible for existing users.** Both new options default to values that preserve pre-PR behavior for jobs that don't opt in: `scan.binlog.newly-added-table.enabled=false` by default (a genuinely new code path, gated off), and `scan.newly-added-table.enabled=true` by default, which — per the diff evidence above — reproduces the connector's pre-existing unconditional restore-time table-reconciliation behavior rather than introducing a new default-on behavior. The new `validateBinlogNewlyAddedTableConfig` guard only rejects a config combination (`scan.binlog.newly-added-table.enabled=true` + fixed `table-names`) that could not have existed before this PR (the option didn't exist), so it breaks no running job.
## 1.3 Performance / Side-Effect Analysis
The capture-pattern filter added in an earlier round (`MySqlIncrementalSource.java:280-298`, reusing Debezium's own `dataCollectionFilter()`) is a per-DDL-event check, not per-row, and is strictly cheaper than the pre-filter code for out-of-scope tables since it skips a `MySqlCatalogTableUtils.toCatalogTable()` conversion. I have no new performance concerns beyond what's already on record; @SEZ9's Issue 5 (no cap/throttle on runtime writer registration) remains a fair open concern I have no counter-evidence against — a burst of matching `CREATE TABLE` statements really would allocate one JDBC writer per table with no ceiling.
## 1.4 Error Handling and Logging
No new swallowed exceptions in this round's delta. `validateBinlogNewlyAddedTableConfig` still fails fast with an actionable message. The one behavior worth flagging for logging: given the E2E evidence above, the registration path fails *silently* from the user's perspective — there is no WARN/ERROR anywhere on the path from "schema-change record received" to "no table registered" when the runtime table never gets picked up, which makes this class of failure hard to diagnose in production, not just in CI.
# 2. Code Quality Assessment
## 2.1 Coding Standards
Unchanged from prior rounds: new methods (`validateBinlogNewlyAddedTableConfig`, `isScanNewlyAddedTableEnabledOnRestore`) carry doc comments, no wildcard imports, ASF headers present on new files.
## 2.2 Test Coverage and Test Stability
**Rating: High risk.** The feature's own dedicated regression test, `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` (`AbstractMysqlCDCITBase.java:868`), is confirmed failing on live CI for the current head — I re-pulled and re-grepped the log myself this round rather than relying on the previous round's citation, and got the identical result (0 registrations logged, deterministic failure across every container variant present in the log). This is not an inference from a diff; it is the actual, reproducible CI outcome for exactly the feature this PR adds. The awaitility-based wait in that test is itself sound (condition-based polling through the expected transient `SQLSyntaxErrorException`, not a disguised sleep), so the "High risk" rating is about the underlying feature not completing end-to-end, not about test flakiness hygiene.
## 2.3 Documentation Updates
@SEZ9's Issues 6 and 7 stand and I have no counter-evidence: `docs/en/connectors/sink/Jdbc.md` is not updated despite `JdbcSinkFactory`/`AbstractJdbcSinkWriter` gaining runtime newly-added-table resolution logic, and neither the EN nor ZH MySQL-CDC page has a runnable HOCON example for the two new options. On the one doc claim I did re-verify myself (`scan.newly-added-table.enabled` default and its restore-behavior description, `docs/en/connectors/source/MySQL-CDC.md:195,232`), the doc text is accurate against the code.
# 3. Architectural Soundness
## 3.1 Elegance of the Solution
The design shape is right — hooking Debezium's own schema-change stream and routing runtime tables through the existing `SupportMultiTableSinkWriter` extension point is a sensible reuse of existing infrastructure rather than a parallel mechanism. What's missing isn't a redesign, it's (a) finding why the registration path doesn't actually fire in the E2E scenario, and (b) closing the restore/checkpoint gaps on both sides of the pipeline.
## 3.2 Maintainability
The `null`-as-"filtered-out" convention through `TableChangeCatalogTableConverter` remains a minor implicit-contract nit (a reader has to know `null` means "intentionally excluded," not "conversion failed"), consistently handled at every call site traced across rounds, so it's a style note rather than a bug.
## 3.3 Extensibility
`isScanNewlyAddedTableEnabledOnRestore()` as an overridable protected hook on the shared `IncrementalSource` base is a reasonable extension point for other CDC connectors that want the same restore-time compatibility switch later.
## 3.4 Historical-Version Compatibility
No serialization/checkpoint format change in this round's delta. Two real historical-compatibility-adjacent risks remain open and are the actual blockers, not the `EventType` ordinal question: (1) a table registered purely via the binlog `CREATE TABLE` path is an in-memory-only addition to the deserializer's live `tables` list — it is never written into the enumerator's checkpointed table set (`IncrementalSource.java:432-441`), so it can silently drop out of a restored job; (2) `SupportMultiTableSinkWriter.createSinkWriter(CatalogTable, Context)` (`seatunnel-api/.../SupportMultiTableSinkWriter.java:54`) has no parameter for restored writer state and no `restoreSinkWriter` counterpart, so a runtime-created writer's pending state (e.g. buffered JDBC batches) cannot survive a restart either. Both need to be closed together — fixing only one side still leaves data-loss/duplication risk on restart for the tables this feature is meant to add.
# 4. Issue Summary
| # | Issue | Location | Severity | Raised by another reviewer |
|---|-------|----------|----------|------------------------------|
| 1 | Feature's own E2E test fails deterministically on live CI for the current head; the success-path log line for binlog table registration never appears in the run | `AbstractMysqlCDCITBase.java:868`; `SeaTunnelRowDebeziumDeserializeSchema.java` (`handleTableChangeStruct`) | High | No (carryover, re-confirmed this round with a fresh independent log pull) |
| 2 | Binlog-registered tables are not part of the source's checkpoint/restore state; lost on restart | `IncrementalSource.java:432-441` | High | No (carryover) |
| 3 | Sink-side runtime-writer SPI has no restore variant; runtime-created writer state cannot survive failure recovery | `SupportMultiTableSinkWriter.java:54` | High | Yes (@SEZ9, Issue 1) |
| 4 | `MultiTableSink` gained factory/config dependencies and a new field (`options`); serialVersionUID/classloader risk not independently confirmed either way | `MultiTableSink.java:23-43,84` | Medium (unconfirmed) | Yes (@SEZ9, Issue 3) |
| 5 | No cap/throttle on runtime writer registration | `SupportMultiTableSinkWriter.java:43` | Medium | Yes (@SEZ9, Issue 5) |
| 6 | JDBC sink docs not updated despite gaining runtime table-creation behavior | `docs/en/connectors/sink/Jdbc.md` (not touched) | Medium | Yes (@SEZ9, Issue 6) |
| 7 | No example HOCON config for the new options | `docs/en/connectors/source/MySQL-CDC.md:196` | Medium | Yes (@SEZ9, Issue 7) |
| 8 | `scan.newly-added-table.enabled` default-value description could be clearer that it reproduces pre-existing restore behavior, not a new one | `docs/en/connectors/source/MySQL-CDC.md:195` | Low (downgraded from @SEZ9's Medium after independently diffing pre-PR `IncrementalSource.java`) | Yes (@SEZ9, Issue 4 — partial disagreement, resolved with evidence) |
| 9 | `EventType.SCHEMA_CHANGE_CREATE_TABLE` inserted at ordinal 0; checked one concrete serialization path (`JobEventReportOperation`) myself and confirmed it is name-based, not ordinal-based, but did not exhaustively audit every connector/serializer | `EventType.java:22` | Low | Yes (@SEZ9, Issue 2 — partial disagreement on severity, upheld from last round) |
| 10 | SPI Javadoc/terminology nits on `SupportMultiTableSinkWriter` (missing `@param`/`@return`/`@throws`, "newly created" vs "newly added" naming) | `SupportMultiTableSinkWriter.java:43,53` | Low | Yes (@SEZ9, Issue 8) |
# 5. Merge Recommendation
### Conclusion: Not recommended for merge
1. Blockers
- Root-cause and fix `testMysqlCdcByWildcardsConfigWithNewlyAddedTable` (Issue 1). This is not a diff-inference this round — I pulled and grepped the CI log myself and got the same deterministic failure, on every container variant, with zero occurrences of the registration success log line.
- Close the checkpoint/restore gap on both sides of the pipeline: the source-side gap (Issue 2, my own carryover) and the sink-side gap (Issue 3, @SEZ9's finding, which I independently confirmed by reading `SupportMultiTableSinkWriter.java` myself). These need a state-aware `restoreSinkWriter`-style counterpart on the sink SPI plus the equivalent treatment on the source-side enumerator checkpoint, so a runtime-registered table doesn't just disappear or lose its writer state across a restart.
2. Recommended fixes (non-blocking)
- Issues 4-7, 9, 10 (MultiTableSink serialization/classloader risk, a registration cap/throttle, JDBC/example doc updates, EventType append-only style, SPI Javadoc/terminology) are all reasonable follow-ups.
- Issue 8 is now mostly a documentation-wording nit rather than an open compatibility question, based on the pre-PR diff evidence above.
Overall assessment: this PR has made real, independently-verifiable forward progress across its many rounds — the capture-pattern filter, the config-validation guard, and an earlier-round snapshot-read column-indexing fix are all genuinely correct and valuable on their own. But the feature's own advertised primary scenario — a table created after the job starts gets picked up and written to without a restart — still does not work on the current head, confirmed by CI evidence I pulled and checked myself this round, and the checkpoint/restore story for a runtime-registered table is incomplete on both the source and the sink side. @SEZ9's review is the only committer-level structured review on this PR so far, and my conclusion agrees with theirs that the blocking items need to be fixed before merge; I'd add that Issue 1 (the E2E test) should be treated as equally blocking alongside the restore-state gaps, since right now the feature cannot be demonstrated to work at all in its
own test. As the author, this is posted as a plain comment rather than a formal review since GitHub does not allow self-approval; it carries no approval weight.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6513685802
Thanks for the continued work on this. A short status update scoped to the open review points.
**CI at head `03973e5cbd3d7f215f80aa2e38e0fe9f053c00ab`:** [Signal pull request update](https://github.com/apache/seatunnel/actions/runs/40642775355/job/122796019439) is `SUCCESS`, but [Build](https://github.com/apache/seatunnel/runs/122809387163) is `FAILURE`, with `MultiTableSinkWriterTest.testRuntimeRegistrationFailurePolicy:234` failing across multiple unit-test lanes, and the engine/MySQL CDC lanes also unsuccessful. Since this PR changes runtime table registration, please treat that test failure as a possible regression rather than infrastructure noise. Could you share the assertion message / stack trace and which policy branch the test exercises? That would help determine whether it relates to the unsupported-sink `CreateTableEvent` handling (F2) or the `IOException` retry/idempotency contract (F5), or is something else. The P0/P1 items already noted earlier in this thread also remain open, so a fix to the registration path alone may not be enough to get exact-head CI green
.
**Still open from the previous review:**
- **F1 / F4 / F8 (identifier handling and target scope):** I still need to see in-code enforcement for names flowing into generated sink SQL and the `${database_name}_${table_name}` template, strict routing/target-scope validation for runtime-created tables, and a decision on the `[A-Za-z_][A-Za-z0-9_$]*` allowlist excluding digit-leading MySQL table names. Please point me at the relevant changes or confirm they are pending.
- **F3 (`scan.newly-added-table.enabled` defaulting to `true`):** please either flip the default to `false` or document the upgrade impact for existing wildcard CDC jobs with a rationale.
- **F6 (`MultiTableState` format change):** please describe how an old checkpoint restores and what happens on version rollback.
- **F7:** the JDBC sink docs still need the `exactly_once = false` / `generate_sink_sql = true` constraints.
Once CI is green on the exact head and the items above are addressed or answered, I'll do a final pass.
<!-- streview-comment:2133 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6538373084
Pushed `d4faf1ea1aab8414aea81371c7c5112078f96739` (merge of `dev` `3ac2d1cec6a`, no conflicts, plus one fix commit). Compile/tests are left to CI per the validation policy; the fork Build for this head is [run 41164176211](https://github.com/DanielLeens/seatunnel/actions/runs/41164176211) (queued at posting time). No `pom.xml`, workflow or unrelated-connector changes.
### Unit test root cause (`MultiTableSinkWriterTest.testRuntimeRegistrationFailurePolicy:234`)
The thrown `[MULTI_TABLE_ISOLATED_FAILURE] ... table=db1.unavailable, phase=checkpoint` comes from `MultiTableSinkWriter.currentSubSinkFailure` (`seatunnel-api/.../MultiTableSinkWriter.java:466-470`, dev code from #10600): under `CONTINUE_OTHER_TABLES`, when `sinkPrimaryKeys` is empty and `failedTables` is not, the coordinator reports the all-tables-isolated state as an isolated-failure `IOException` (the same contract `testRuntimeWriteZeroRetryKeepsImmediateIsolation` asserts). The test built the sink with an empty startup writer map, so after the only runtime table was quarantined there was no live table left and the rule fired inside `applySchemaChange`. The production policy path is correct and unchanged; the test now starts with one healthy table (`db1.healthy`), keeps every previous assertion (3 attempts, quarantine checkpointed, no runtime table recorded) and additionally asserts that the healthy table keeps writing and no row of the rejected table reaches a writer. This an
swers @SEZ9's question: the branch is the non-fail-fast policy path, not F2 (unsupported sink) or F5 (retry/idempotency).
### Issue 1 (P0, two-replica deadlock) — `MultiTableSinkWriter.registerNewlyCreatedTable`, `MultiTableWriterRunnable.registerWriterAtSchemaChangeBarrier`
Design note: registration runs only on the barrier dispatcher, i.e. the last queue worker inside `SchemaChangeBarrier.reachBarrier()`. At that point every worker, the dispatcher included, is parked in `MultiTableWriterRunnable.run()` holding its own runnable monitor, and every coordinator path that mutates the per-queue registries (`snapshotState`, `prepareCommit`, `aggregatedFlush`, `close`, `removeTableWriters`) blocks on those monitors until the latch is released. The barrier therefore already gives the dispatcher exclusive access; the two `synchronized (runnable.get(i))` blocks and the synchronized `registerWriter` were the only way to wait on a parked worker, and that is the lock/latch cycle. Both were removed: the registries are installed without any runnable monitor and the runnable exposes a package-private, unsynchronized `registerWriterAtSchemaChangeBarrier` whose Javadoc states the barrier-only contract and the happens-before provided by the latch count-down. No other s
ynchronization was touched. Regression: `testRuntimeCreateTableRegistersOnEveryQueueWithoutDeadlock` (two queues, one CREATE, rows hashed to both queues, checkpoint with two writer states, bounded by `assertTimeoutPreemptively(30s)`; the previous code hangs it).
### Issue 2 (P0, runtime table lost on automatic recovery) — `SeaTunnelRowDebeziumDeserializeSchema.restoreCheckpointProducedType/emitPendingRestoreSchemaEvents`, `IncrementalSourceReader.admitCheckpointedRuntimeTables`
Design note: with `scan.binlog.newly-added-table.enabled`, a checkpoint table absent from the submitted catalog is no longer treated as deleted: its checkpointed schema is admitted into `tables`/`tableRowConverters` and a `CreateTableEvent` is emitted before the first resumed record, so the engine row-type map and the sink writer are re-established (sinks treat the replayed CREATE as idempotent; JDBC is create-if-missing). While verifying the review's recovery path I found one more gap on the same path: the restored split's `tableIds` never contained the runtime table, and `JdbcSourceFetchTaskContext.registerDatabaseHistory` registers Debezium history only for `tableIds`, so after recovery the resumed rows of that table would hit Debezium's "schema isn't known" handling (`inconsistent.schema.handling.mode`, FAIL by default) before reaching the deserializer. The reader's existing restore reconciliation (`addSplits` -> prune against live captured tables) now also appends tables that
exist only in the checkpointed produced type (not in the submitted catalog, not in `tableIds`) to the split's captured ids, after pruning, so a table dropped or excluded while the job was stopped stays out. For jobs without runtime admission the checkpointed tables are always a subset of the submitted catalog, so that step is a no-op. Opt-out is preserved: restoring with the option off keeps the legacy "deleted" path. Regressions: `testRestoreAdmitsCheckpointedRuntimeTableAbsentFromSubmittedCatalog` (deserializer initialized with A only, checkpoint A+B, B DML -> CREATE(B) then row), `testRestoreKeepsDroppingUnknownCheckpointTableWhenRuntimeDiscoveryDisabled`, and `IncrementalSourceReaderTest.testAddSplitsAdmitsCheckpointedRuntimeTableIntoCapturedTableIds`. An engine-level master-failover E2E is not added in this push; the Zeta restore path above is covered at the unit level and left for CI/E2E follow-up.
### Issue 3 (High, include list suppresses CREATE after admission) — `SeaTunnelRowDebeziumDeserializeSchema.emitPendingCreateTableEvents`, `SchemaChangeEventFilter`
Design note (option chosen: required control event, documented filter contract): the CREATE of a runtime-admitted table is what creates the downstream row type and sink writer that the table's following rows depend on, so it is not a filterable schema change. `emitPendingCreateTableEvents` no longer applies the include/exclude filter, and `SchemaChangeEventFilter.filter` passes `CreateTableEvent` through unconditionally (class Javadoc updated). Admission and emission are now consistent at the source: an admitted table always gets its CREATE before DML; a rejected table (unsafe identifier/type) gets neither. The en/zh docs state that the lists only govern column-level DDL of captured tables. Regression: `testIncludeFilterDoesNotSuppressRuntimeCreateTableBeforeDml` (`SchemaChangeEventFilter.fromConfig` with `include=["add.column"]`, CREATE record then DML -> `create:db1.new_table`, `row:db1.new_table` in that order).
### SEZ9 open points (10-30 status comment)
- F1/F4/F8 (identifier handling, target scope): in-code enforcement is `MySqlCatalogTableUtils.toRuntimeCatalogTable` (`connector-cdc-mysql/.../utils/MySqlCatalogTableUtils.java:47-48,124-128`): runtime identifiers must match `[A-Za-z0-9_$]*[A-Za-z_$][A-Za-z0-9_$]*` (digit-leading names such as `2024_orders` are accepted, all-numeric/backtick/semicolon names rejected with a WARN, no CREATE and no rows emitted); unsupported MySQL types are rejected there too (`:98-104`). Target scope: `MultiTableSinkWriter.hasSourceMatchedWriter` rejects a CREATE whose identity does not match its catalog table before any factory call (`testRuntimeCreateRejectsMismatchedIdentityBeforeFactory`), CREATE is dispatched only to the source-matched writer (`collectSchemaChangeDispatchTargets`, never to shared-target siblings), and the JDBC target comes only from the sink's configured `database`/`table` template, never from the source CREATE (`JdbcSinkFactory`, `AbstractJdbcSinkWriter` resolved-target save
mode). Nothing is pending there.
- F3 (`scan.newly-added-table.enabled` default `true`): kept `true` deliberately; the published `v3.0.0` `IncrementalSource.restore` already appended newly matched tables on hybrid restore, so `true` is the no-behaviour-change default for existing wildcard jobs and explicit `false` is the new opt-out (`MySqlIncrementalSource.isScanNewlyAddedTableEnabledOnRestore`, docs option table and "Newly Added Tables"). Runtime binlog discovery is a separate option that defaults to `false`.
- F6 (`MultiTableState` format): `serialVersionUID` is pinned to the pre-change value (`5992121739651030596L`), `runtimeCreatedTables` is a new trailing field with a null-safe getter, so an old checkpoint restores with an empty runtime-table list (asserted by the legacy-state test). Rollback: a checkpoint written by this version that contains runtime tables is not readable by a version without the field semantics; the docs instruct keeping a pre-upgrade checkpoint and planning binlog retention before downgrading.
- F7: `docs/en/connectors/sink/Jdbc.md` "Runtime tables from MySQL CDC" (`:57-59`) already states `is_exactly_once = false` and `generate_sink_sql = true` without a custom `query`; `JdbcSinkFactory` enforces it at `:469-477`.
Tests left to CI: `MultiTableSinkWriterTest`, `SeaTunnelRowDebeziumDeserializeSchemaTest`, `IncrementalSourceReaderTest` plus the engine-v2-it and mysql-cdc-connector-it lanes that were red on the previous head must be re-evaluated on this exact head. Self-authored PR note: this comment is from the PR author account and carries no approval weight.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6139066019
Follow-up to the latest review on commit `9007896511517e4b874142cfe704102861bbc444`:
- Synced the branch with current `apache/dev` (`b0f6feddf9ed0dc1f5d485cfc69d387edfe6ac82`) by merge, not rebase. The only conflict was in `MySqlIncrementalSourceFactory`; the resolution keeps both the current dev specific-offset guards and this PR's newly-added-table options.
- Fixed the restore compatibility blocker by changing `scan.newly-added-table.enabled` to opt-in (`false` by default) and updating the English and Chinese MySQL CDC docs.
- Added a real runtime-sink capability gate before sink/writer creation. `TableSinkFactory` defaults to unsupported, JDBC explicitly opts in, and an unsupported sink now fails early with the sink type and table path instead of entering generic factory creation.
- Caught rejected runtime identifiers at the CDC deserializer boundary, logging a WARN and skipping only that table instead of failing the whole task. Added a negative regression test.
- Expanded the safe MySQL identifier rule to accept legal digit-leading names such as `2024_orders` while still rejecting all-numeric and unsafe names, with tests.
- Added English and Chinese JDBC sink documentation for runtime tables discovered by MySQL CDC.
The remaining Medium follow-ups about multi-sink target pinning, an explicit retry/idempotency contract, and old-format checkpoint/rollback documentation are unchanged in this commit.
Verification performed locally: `spotless:apply` and `spotless:check` passed for `seatunnel-api`, `connector-cdc-base`, `connector-cdc-mysql`, and `connector-jdbc`; `git diff apache/dev...HEAD --check` passed; the final PR diff against current `apache/dev` contains no `pom.xml` changes. Per the repository workflow for this task, I did not run local compilation or tests. GitHub CI is queued.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "davidzollo (via GitHub) via commits" <co...@seatunnel.apache.org>.
davidzollo commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6870278972
<!-- daniel-maintenance-20261113-11206-93afd1a996b2 -->
Maintenance update for `93afd1a996b26e84b8ab843d31c736aa20ae3e9c`.
The conflict resolution is prepared locally. It keeps the upstream parallel flush implementation and snapshot-only restore logic alongside this PR's runtime registration and restore gate. The existing JdbcSinkWriterTest failures remain: the runtime-create fixtures use a dialect mock without schema-change support enabled.
The conflict audit also found an existing blocker in the runtime create path. If registration succeeds for the first queue and then exhausts retries for a later queue under CONTINUE_OTHER_TABLES, failure handling calls removeTableWriters while the other queue workers still hold their monitors and wait for the schema-change barrier. This can leave the dispatcher and those workers waiting on each other. Defer isolation until after the barrier releases and cover a partial registration with more than one queue. A separate outstanding case is timer registration when the first flush-capable child is created at runtime. These findings come from source; no new runtime validation was run.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-6995577080
Thanks for the update. The repair to the failure path looks right: failed-writer quarantine now runs after the barrier is released, and the two-replica fixtures exercise it. Here is what I still need on the previously raised points.
**Still open**
- **JDBC capability check.** `JdbcSinkFactory.supportsNewlyCreatedTable()` still declares the capability globally, even for incompatible configs. Please make it config-aware, so an exactly-once or custom-`query` JDBC sink is rejected before any writer is built. That way the job fails instead of the table being quarantined under `CONTINUE_OTHER_TABLES`.
- **Retry while the barrier is held.** Quarantine now happens after release, but the retries appear to run before it. Do the retry sleeps still happen while every queue worker is parked at the schema-change barrier? If so, one failing new table still stalls all tables and checkpoints for the whole retry window, so please bound that window or move the retry off the barrier.
- **Skipped rows.** Rows skipped for a quarantined table under `CONTINUE_OTHER_TABLES` are not guaranteed to replay later. Please make sure this is clearly visible to users.
- **Unbounded runtime admission.** I don't see an upper bound or a removal path for runtime-admitted tables, so sink writers and checkpoint state can still grow without limit. Please add a bound, or explain how this is constrained.
**Please confirm**
- **Zeta with a single initial table.** The collector now updates the row type and sends the event before rows. Does this also cover a job that starts with exactly one matched table, where the produced type is not a `MultipleRowType`? A test for that case would settle it.
- **DROP followed by re-CREATE.** What happens now when a second `CREATE TABLE` arrives for an already-registered path with a different schema? Please confirm the converters and the sink schema are refreshed rather than the event being ignored.
**Docs (`docs/en/connectors/source/MySQL-CDC.md`)**
I can't tell whether these three were updated, so please point me to the changes or add them:
- How the runtime option relates to `schema-changes.enabled`, and that it overrides a user-supplied `debezium { include.schema.changes }`.
- That `scan.binlog.newly-added-table.enabled` is rejected at startup when `table-names` is configured, in both the option row and the "Newly Added Tables" section.
- Which engines support runtime table registration.
<!-- streview-comment:2452 -->
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7006931929
Thanks @SEZ9. I agree that the safe quarantine lock boundary does not by itself close the configuration-aware JDBC capability check, retries while healthy queues are parked, single-initial-table path, DROP/re-CREATE handling, runtime admission bound or the documented skipped-row semantics. These are already part of Daniel's previous current-head conclusion; I am not adding duplicate numbered findings. Please address them together in the next commit and retain the failing restore-admission test as a separate concrete acceptance gate. The current dev conflict and exact-head CI remain independent requirements.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7212914695
Thanks, @SEZ9. That matches the remaining scope: the startup schema promotion and config-aware JDBC precheck are closed, while the previously recorded table-local retry/admission, changed-schema re-CREATE handling and bounded runtime admission remain open. The three EN/ZH contract clarifications also still need the same coordinated update. There is no new commit to verify, so this reply does not claim those changes are implemented. Please retain the existing issue identities and tie the next update to the three regression scenarios you listed; no additional source issue is being added in this follow-up.
This is a discussion/gate follow-up on unchanged head `34d388c9150d5bbf83591bbf1e3e3a930e342342`, not a new full source review. Base `dev` compare: `diverged`, ahead 42 / behind 71. Branch drift alone is not a request to sync. No local build/test/runtime execution was performed. Daniel has READ permission; any required write-capable maintainer approval or historical-review dismissal remains separate.
--
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] [Feature][Connector-V2] Support MySQL CDC newly added tables [seatunnel]
Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #11206:
URL: https://github.com/apache/seatunnel/pull/11206#issuecomment-7230180537
Thanks for the follow-up. Here is where things stand on head `34d388c9150d5bbf83591bbf1e3e3a930e342342`; nothing below is confirmed as fixed until a new commit is pushed.
**Closed, not reopened**
- PR11206-F2: runtime `CreateTableEvent` registration when the job starts with a single matched table.
- PR11206-F1: config-aware `supportsNewlyCreatedTable()` precheck for exactly-once and custom-`query` JDBC sinks.
**Still open for the next update**
- **PR11206-F5:** runtime writer creation retry needs to be table-local and happen outside the shared schema-change barrier. One failing new table should not stall the other tables or checkpoints for the whole retry window.
- **PR11206-F7:** an idempotent `CREATE TABLE` replay needs to be distinguished from DROP followed by re-CREATE with a different schema. The latter must not leave stale converters or a stale sink schema.
- **PR11206-F8:** runtime table and writer admission needs an upper bound and a retirement path, so sink writers and checkpoint state cannot grow without limit.
- **PR11206-F9 (docs):** explain how the runtime option relates to `schema-changes.enabled`, and that it overrides a user-supplied `debezium { include.schema.changes }`.
- **PR11206-F10 (docs):** state in both the option row and the "Newly Added Tables" section that `scan.binlog.newly-added-table.enabled` is rejected at startup when `table-names` is configured.
- **PR11206-F11 (docs):** state which engines support runtime table registration.
**Asks**
- Please land the three docs items in both the EN and ZH pages, in the same update as the code changes.
- Please keep the existing finding IDs in the update description.
- Could you restate the three regression scenarios you listed and map each to the test that covers it? That lets each item be verified one by one.
No new issues are being added here.
<!-- streview-comment:2670 -->
--
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