Skip to content

Commit

Permalink
add wait async ddl description
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesCheung96 committed Sep 2, 2024
1 parent c459ea3 commit 2a57460
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ticdc/ticdc-ddl.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ summary: 了解 TiCDC 支持同步的 DDL 和一些特殊情况

为了减小对 Changefeed 同步延迟的影响,如果下游是 TiDB,TiCDC 会异步执行创建和添加索引的 DDL 操作,即 TiCDC 将 `ADD INDEX``CREATE INDEX` DDL 同步到下游执行后,会立刻返回,而不会等待 DDL 操作完成。这样可以避免阻塞后续的 DML 执行。

`ADD INDEX``CREATE INDEX` DDL 在下游执行期间,TiCDC 同步同一张表的下一条 DDL 时,可能因为新的 DDL 被阻塞导致同步任务失败。如果 TiCDC 拥有下游数据库的 `SUPER` 权限,TiCDC 可以通过 `ADMIN SHOW DDL JOBS` 查询异步执行的 DDL 任务的状态,直到索引创建完成后再继续同步,这期间同步任务的延迟会上升,但避免了同步任务失败。

> **注意:**
>
> - 如果下游 DML 的执行依赖于未完成同步的索引,DML 可能会执行得很慢,进而影响 TiCDC 的同步延迟。
Expand Down

0 comments on commit 2a57460

Please sign in to comment.