DM synchronization between MySQL instances: Upstream 'CREATE TABLE AS SELECT * FROM table1' causes synchronization error, and 'skip' cannot bypass this DDL

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: DM进行mysql之间同步,上游create table as select * from table1,同步报错,skip无法跳过该ddl

| username: mm喝茶吧

[TiDB Usage Environment] Production Environment / Testing / Poc
[TiDB Version]
[Reproduction Path] DM synchronizing between MySQL instances, upstream create table as select * from table1, synchronization error, skip cannot bypass this DDL
[Encountered Problem: Problem Phenomenon and Impact]
[Resource Configuration] 4c/8G
[Attachments: Screenshots/Logs/Monitoring]


| username: redgame | Original post link

I can’t tell from this. Do you have any other hints or information? Like logs or something?

| username: mm喝茶吧 | Original post link

The image you provided is not visible. Please provide the text you need translated.

| username: 有猫万事足 | Original post link

The reason why it cannot be skipped, I think, is that you haven’t found the right position. It looks like TiDB does not support the create table ... start transaction syntax. It can be imagined that there should be a bunch of insert into statements following this. These should all be skipped.

So you should open the binlog and find the end of this series of insert statements in the binlog. Skip over it completely.

Additionally, you should consider whether it is necessary to synchronize this table in such a situation.

create table as select * from table1

If the table1 only has a small amount of data, it might be actions like testing in the production environment or casually backing up some table data by the developers. If table1 has any significant amount of data, synchronizing this table creation method downstream would create a write hotspot. There is no need to follow the upstream in such a hassle. If synchronization is indeed needed later, just add a separate task to handle the newly created table. Getting DM synchronization stuck on other tables for such a situation is generally not worth it.

The suggested solution in the prompt, which says to add a DDL filter to filter out these unnecessary DDLs, is better.

| username: TiDB_C罗 | Original post link

What is the “start transaction” after “create table”?

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.