docs: clarify TiCDC index DDL ordering#21829
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughTiCDC 文档更新了 TiDB 下游 ChangesTiCDC 索引 DDL 执行顺序说明
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/cc @wk989898 |
| ### 创建和添加索引 DDL 的异步执行 | ||
|
|
||
| 为了减小对 Changefeed 同步延迟的影响,如果下游是 TiDB,TiCDC 会异步执行创建和添加索引的 DDL 操作,即 TiCDC 将 `ADD INDEX` 和 `CREATE INDEX` DDL 同步到下游执行后,会立刻返回,而不会等待 DDL 操作完成。这样可以避免阻塞后续的 DML 执行。 | ||
| 虽然 TiCDC 在大多数情况下会按顺序同步 DDL,但如果下游是 TiDB,TiCDC 会异步执行创建和添加索引的 DDL 操作,即 TiCDC 将 `ADD INDEX` 和 `CREATE INDEX` DDL 同步到下游执行后,会立刻返回,而不会等待 DDL 操作完成。这样可以减小对 Changefeed 同步延迟的影响,避免阻塞后续的 DML 执行。 |
There was a problem hiding this comment.
| 虽然 TiCDC 在大多数情况下会按顺序同步 DDL,但如果下游是 TiDB,TiCDC 会异步执行创建和添加索引的 DDL 操作,即 TiCDC 将 `ADD INDEX` 和 `CREATE INDEX` DDL 同步到下游执行后,会立刻返回,而不会等待 DDL 操作完成。这样可以减小对 Changefeed 同步延迟的影响,避免阻塞后续的 DML 执行。 | |
| 虽然 TiCDC 在大多数情况下会按顺序同步 DDL,但如果下游是 TiDB,TiCDC 会异步执行创建和添加索引的 DDL 操作,即 TiCDC 将 `ADD INDEX` DDL 同步到下游执行后,会立刻返回,而不会等待 DDL 操作完成。这样可以减小对 Changefeed 同步延迟的影响,避免阻塞后续的 DML 执行。 |
| 2. TiCDC 继续同步 DDL。当存在多个 DDL 时,TiCDC 通常以串行的方式进行同步。 | ||
| 3. 当 DDL 在下游执行完成之后,TiCDC 继续同步 DDL `commitTS` 之后执行的 DML。 | ||
|
|
||
| 对于 `ADD INDEX` 和 `CREATE INDEX`,当下游是 TiDB 时,TiCDC 会异步执行这两类 DDL,不会等待其在下游执行完成后再返回,以减小对 Changefeed 同步延迟的影响。更多信息,请参考[创建和添加索引 DDL 的异步执行](/ticdc/ticdc-ddl.md#创建和添加索引-ddl-的异步执行)。 |
There was a problem hiding this comment.
| 对于 `ADD INDEX` 和 `CREATE INDEX`,当下游是 TiDB 时,TiCDC 会异步执行这两类 DDL,不会等待其在下游执行完成后再返回,以减小对 Changefeed 同步延迟的影响。更多信息,请参考[创建和添加索引 DDL 的异步执行](/ticdc/ticdc-ddl.md#创建和添加索引-ddl-的异步执行)。 | |
| 对于 `ADD INDEX`,当下游是 TiDB 时,TiCDC 会异步执行这两类 DDL,不会等待其在下游执行完成后再返回,以减小对 Changefeed 同步延迟的影响。更多信息,请参考[创建和添加索引 DDL 的异步执行](/ticdc/ticdc-ddl.md#创建和添加索引-ddl-的异步执行)。 |
|
@wk989898: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
First-time contributors' checklist
What is changed, added or deleted? (Required)
ADD INDEXandCREATE INDEXwhen the downstream is TiDB.Which TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
AI agent involvement
Do your changes match any of the following descriptions?
Summary by CodeRabbit
ADD INDEX/CREATE INDEX属于例外”,说明 TiCDC 会在下游同步后立即返回,不等待 DDL 完成以避免阻塞后续 DML。如何理解 DML 和 DDL 之间的执行顺序?中补充 TiDB 场景下ADD INDEX/CREATE INDEX的异步例外,并补充相关参考链接。