Commit 37c544c
[FLINK-38911][mysql] Support binlog-only newly added table capture for DataStream API
This commit implements the binlog-only newly added table capture feature for MySQL CDC DataStream connector, allowing dynamic table discovery without snapshot phase.
Key changes:
- Add new config option 'scan.binlog.newly-added-table.enabled' in MySqlSourceOptions
- Add scanBinlogNewlyAddedTableEnabled field and getter in MySqlSourceConfig
- Implement table pattern conversion from Flink CDC style to Debezium style in MySqlSourceConfigFactory
- Add validation logic to ensure binlog-only mode works only with stream-only startup modes
- Enhance BinlogSplitReader to auto-capture newly added tables matching the pattern
- Add logging in MySqlSnapshotSplitAssigner for binlog-only mode
- Expose scanBinlogNewlyAddedTableEnabled() API in MySqlSourceBuilder
The feature converts table patterns (e.g., "db.table_\.*") to Debezium regex style (e.g., "db\.table_.*")
and enables dynamic table discovery during binlog reading phase without triggering snapshots.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 09a0383 commit 37c544c
2 files changed
Lines changed: 16 additions & 23 deletions
File tree
- flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql
- debezium/reader
- source
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
316 | 327 | | |
317 | 328 | | |
318 | 329 | | |
| |||
Lines changed: 3 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
237 | 219 | | |
238 | 220 | | |
239 | 221 | | |
| |||
0 commit comments