-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[FLINK-34864][cdc-connector-mysql] Add the IgnoreNoPrimaryKeyTable parameter to skip tables without primary keys in multi-table synchronization #4027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…rameter to skip tables without primary keys in multi-table synchronization
...test/java/org/apache/flink/cdc/connectors/mysql/source/assigners/MySqlChunkSplitterTest.java
Outdated
Show resolved
Hide resolved
...c/src/main/java/org/apache/flink/cdc/connectors/mysql/debezium/reader/BinlogSplitReader.java
Outdated
Show resolved
Hide resolved
...mysql/src/main/java/org/apache/flink/cdc/connectors/mysql/source/MySqlDataSourceOptions.java
Outdated
Show resolved
Hide resolved
"Whether to ignore tables without primary key. When enabled, the connector will skip tables " | ||
+ "that don't have a primary key. By default these tables will be processed, but for some " | ||
+ "scenarios it may be desirable to ignore them since tables without primary keys " | ||
+ "might cause performance issues during incremental snapshot."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would happen if we met the records of these tables in incremental reading phase? Skip it or emit it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will skip them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an ITCase test to verify it during snapshot and incremental reading phases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code logic content has been newly added and verified through testing.
...src/main/java/org/apache/flink/cdc/connectors/mysql/source/assigners/MySqlChunkSplitter.java
Show resolved
Hide resolved
…c table creation of tables without primary keys and the issue of incremental data synchronization
# Conflicts: # docs/content.zh/docs/connectors/flink-sources/mysql-cdc.md # docs/content/docs/connectors/flink-sources/mysql-cdc.md
…c table creation of tables without primary keys and the issue of incremental data synchronization
@lvyanquan Could you please let me know when you can take a look at this PR and merge it? |
https://issues.apache.org/jira/browse/FLINK-34864
Previously, in the scenario of multi-table synchronization such as from MySQL to Doris, if some tables had no primary keys, it would directly result in an error, which affected the synchronization of other tables. Therefore, relevant development work was carried out. Incidentally, I found that this issue had already been recorded on Jira. As a result, I added unit tests and other content and submitted this pull request (PR). The specific usage is to set the ignoreNoPrimaryKeyTable parameter to "true" in the pipeline of the YAML file, and then this function can be achieved.