diff --git a/ticdc/ticdc-ddl.md b/ticdc/ticdc-ddl.md index 822c1a89d186e..91be173ead44d 100644 --- a/ticdc/ticdc-ddl.md +++ b/ticdc/ticdc-ddl.md @@ -46,9 +46,20 @@ The allow list of DDL statements supported by TiCDC is as follows: ## DDL replication considerations +### Asynchronous execution of `ADD INDEX` and `CREATE INDEX` DDLs + +When the downstream is TiDB, TiCDC executes `ADD INDEX` and `CREATE INDEX` DDL operations asynchronously to minimize the impact on changefeed replication latency. This means that, after replicating `ADD INDEX` and `CREATE INDEX` DDLs to the downstream TiDB for execution, TiCDC returns immediately without waiting for the completion of the DDL execution. This avoids blocking subsequent DML executions. + +> **Note:** +> +> - If the execution of certain downstream DMLs relies on indexes that have not completed replication, these DMLs might be executed slowly, thereby affecting TiCDC replication latency. +> - Before replicating DDLs to the downstream, if a TiCDC node crashes or if the downstream is performing other write operations, the DDL replication has an extremely low probability of failure. You can check the downstream to see whether that occurs. + +### DDL replication considerations for renaming tables + Due to the lack of some context during the replication process, TiCDC has some constraints on the replication of `RENAME TABLE` DDLs. -### Rename a single table in a DDL statement +#### Rename a single table in a DDL statement If a DDL statement renames a single table, TiCDC only replicates the DDL statement when the old table name matches the filter rule. The following is an example. @@ -69,7 +80,7 @@ TiCDC processes this type of DDL as follows: | `RENAME TABLE test.n1 TO test.t1` | Report an error and exit the replication | `test.n1` does not match the filter rule, but `test.t1` matches the filter rule. This operation is illegal. In this case, refer to the error message for handling. | | `RENAME TABLE ignore.t1 TO test.t1` | Report an error and exit the replication | Same reason as above. | -### Rename multiple tables in a DDL statement +#### Rename multiple tables in a DDL statement If a DDL statement renames multiple tables, TiCDC only replicates the DDL statement when the old database name, old table names, and the new database name all match the filter rule.