doris-flink-connector icon indicating copy to clipboard operation
doris-flink-connector copied to clipboard

[Bug] mysql-sync-database should skip no-PK tables in initial snapshot mode or provide clear guidance

Open Cq-study opened this issue 9 months ago • 0 comments

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

  1. Prepare a MySQL database with mixed tables:
    • table A: has primary key
    • table B: no primary key
  2. Run mysql-sync-database with broad table pattern (e.g. including-tables=".*").
  3. Use startup mode initial and 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)

Cq-study avatar Mar 05 '26 06:03 Cq-study