Hi guys,

I would like to start a discussion for STIP-29:

[STIP-29] [Feature][Connector-V2] Support Newly Added Tables in MySQL CDC
https://github.com/apache/seatunnel/issues/11031

*Background*
SeaTunnel MySQL CDC already supports snapshot reading and incremental
binlog reading for tables discovered when the job starts. It also has
partial restore-time reconciliation for newly matched tables after
checkpoint/savepoint restore.

However, for full-database synchronization with `database-pattern` and
`table-pattern`, tables created after the job enters the binlog phase are
not handled as first-class tables today. In practice, this means newly
created tables may be ignored by the source-side schema cache/deserializer
or rejected by downstream multi-table sinks.

This proposal introduces explicit support for newly added tables in MySQL
CDC with two separate semantics:

1. `scan.newly-added-table.enabled`
This is effective when restoring from checkpoint/savepoint.
Newly matched tables will be added back into snapshot planning first, then
continue with incremental reading.

2. `scan.binlog.newly-added-table.enabled`
This is effective during binlog reading.
The source can register newly created table schemas and consume subsequent
DML for those tables, but it does not backfill historical snapshot data for
tables that were already created before discovery.

*Why split these into two options*
These two cases have different correctness semantics:

- restore-time newly added tables can still go through snapshot + binlog
- running-job binlog-phase newly added tables are binlog-only in the first
phase

I think they should not be hidden behind a single ambiguous option.

*Current implementation scope*
I have prepared an initial implementation and documentation update for
MySQL CDC source-side support, including:

- explicit MySQL CDC options for restore-time and binlog-phase newly added
tables
- restore-time gating to preserve backward-compatible behavior
- dynamic schema registration for newly created tables during binlog reading
- MySQL schema fallback for table cache misses
- related unit tests and connector docs updates

At the same time, I want to be explicit about the current boundary:
this first phase mainly solves source-side discovery/registration and
restore-time compatibility.
A complete end-to-end solution for full-database sync of runtime new tables
may still need a follow-up API/STIP for dynamic multi-table sink writer
creation and create-table event propagation.

*Main discussion points*
I would especially like feedback on these points:

1. Whether the two-option design is reasonable for correctness and usability
2. Whether `scan.newly-added-table.enabled` should remain default `true` to
preserve current restore behavior
3. Whether `scan.binlog.newly-added-table.enabled` should default to `false`
4. Whether the first phase should stay source-scoped, with sink-side
dynamic table creation handled in a follow-up STIP
5. Whether the naming and documented semantics are clear enough for users

Any feedback is welcome.



Best Regards,
David
Linkedin: https://www.linkedin.com/in/davidzollo

Reply via email to