doris-flink-connector
doris-flink-connector copied to clipboard
[Bug] mysql-sync-database should skip no-PK tables in initial snapshot mode or provide clear guidance
Search before asking
- [x] I had searched in the issues and found no similar issues.
Description
Bug Description
When using mysql-sync-database for full-database real-time sync, tables without primary keys are not filtered automatically.
In initial startup mode (incremental snapshot phase), these no-PK tables may fail split/chunk-based snapshot reading, causing the Flink job to repeatedly fail and restart.
Version
- Doris Flink Connector: master (or latest snapshot)
- Flink: 1.17.x
- Source DB: MySQL
- Runtime: Flink CDC incremental snapshot mode (
scan.startup.mode=initial)
Reproduction Steps
- Prepare a MySQL database with mixed tables:
- table A: has primary key
- table B: no primary key
- Run
mysql-sync-databasewith broad table pattern (e.g.including-tables=".*"). - Use startup mode
initialand do not configure chunk key for no-PK table.
Expected Behavior
- Connector should not include no-PK tables in snapshot sync by default, or
- provide explicit and clear guidance/error before job starts unstable retries.
- If user explicitly configures chunk key for a no-PK table, that table should still be syncable.
Actual Behavior
- no-PK tables are included in source table list;
- snapshot split/chunk phase fails;
- job keeps failing/restarting.
Logs / Error (example)
(snapshot split read failure on no primary key table)
(job restart loop)
### Solution
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)