Skip to content

ticdc: Update DDL behavior notes about add/drop/modify column - #21933

Open
wk989898 wants to merge 2 commits into
masterfrom
wk989898-patch-1
Open

wk989898 wants to merge 2 commits into
masterfrom
wk989898-patch-1

Conversation

@wk989898

@wk989898 wk989898 commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Clarified behavior of DDL operations involving columns and indexes.

First-time contributors' checklist

What is changed, added, or deleted? (Required)

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions (in Chinese).

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)

What is the related PR or file link(s)?

AI agent involvement

  • The changes in this PR were primarily made by an AI agent on behalf of the PR author.

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

Summary by CodeRabbit

  • 文档
    • 补充 DDL 白名单注意事项:当 ADD COLUMNDROP COLUMNMODIFY COLUMN 涉及有效索引的添加或删除时,其行为应与 ADD INDEXDROP INDEX 等 DDL 操作保持一致。
    • 更新 ADD COLUMNMODIFY COLUMN 的白名单说明:在 force-replicate=false 且无有效索引时,涉及有效索引添加则标记为 Y,否则标记为 N。

Clarified behavior of DDL operations involving columns and indexes.
@ti-chi-bot

ti-chi-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign icemap for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added missing-translation-status This PR does not have translation status info. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 15, 2026
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 5801c76b-8ede-4dd5-bd5b-727f72bbd8af

📥 Commits

Reviewing files that changed from the base of the PR and between cece8ff and 35e670c.

📒 Files selected for processing (1)
  • ticdc/ticdc-ddl.md

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

本次变更更新 DDL 白名单文档。文档新增有效索引变更说明,并将 ADD COLUMNMODIFY COLUMN 的适用值改为条件值。

Changes

DDL 白名单说明

Layer / File(s) Summary
补充索引相关 DDL 规则
ticdc/ticdc-ddl.md
新增说明:相关列操作涉及有效索引添加或删除时,应与 ADD INDEXDROP INDEX 等 DDL 保持一致。ADD COLUMNMODIFY COLUMN 的值在添加有效索引时为 Y,否则为 N。

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 35e67

The documentation update has no unresolved material risk identified in the reviewed scope.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed 标题准确概括了本次文档更新,明确说明了涉及列操作和索引行为的变化。
Description check ✅ Passed 描述包含变更摘要、CLA、适用版本、相关 PR 链接及其他模板字段。必填项均已填写或明确标记。
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wk989898-patch-1

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 6f742530-be2c-4da7-8e80-4eafe2a4306f

📥 Commits

Reviewing files that changed from the base of the PR and between 924e58f and cece8ff.

📒 Files selected for processing (1)
  • ticdc/ticdc-ddl.md

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread ticdc/ticdc-ddl.md
>
> - 当上游表不存在有效索引,且未配置 `force-replicate=true` 时,该表不会被同步,但是之后在该表上创建有效索引的 DDL (`CREATE INDEX`、`ADD INDEX` 和 `ADD PRIMARY KEY`)会被同步,下游表和上游表结构可能产生不一致从而导致后续数据同步失败。
> - 删除最后一个有效索引的 DDL(`DROP INDEX` 和 `DROP PRIMARY KEY`)不会被同步,并且导致后续数据同步失败。
> - 如果 `ADD COLUMN`,`DROP COLUMN`,`MODIFY COLUMN` 涉及到有效索引的添加删除,其行为表现应该与 `ADD INDEX`,`DROP INDEX`等 DDL 行为表现一致。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

明确列出涉及有效索引变更的 DDL。

DDL 白名单列出了 CREATE INDEXADD INDEXDROP INDEXADD PRIMARY KEYDROP PRIMARY KEY。当前仅列出前两类操作,等 DDL 未明确涵盖主键变更。请替换为:

可直接提交的修改
Suggested change
> - 如果 `ADD COLUMN``DROP COLUMN``MODIFY COLUMN` 涉及到有效索引的添加删除,其行为表现应该与 `ADD INDEX``DROP INDEX`等 DDL 行为表现一致
> - 如果 `ADD COLUMN``DROP COLUMN``MODIFY COLUMN` 涉及添加或删除有效索引,其行为应与 `CREATE INDEX``ADD INDEX``DROP INDEX``ADD PRIMARY KEY``DROP PRIMARY KEY` 等 DDL 的行为一致
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
> - 如果 `ADD COLUMN``DROP COLUMN``MODIFY COLUMN` 涉及到有效索引的添加删除,其行为表现应该与 `ADD INDEX``DROP INDEX`等 DDL 行为表现一致
> - 如果 `ADD COLUMN``DROP COLUMN``MODIFY COLUMN` 涉及添加或删除有效索引,其行为应与 `CREATE INDEX``ADD INDEX``DROP INDEX``ADD PRIMARY KEY``DROP PRIMARY KEY` 等 DDL 的行为一致

@ti-chi-bot

ti-chi-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown

@wk989898: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-verify 35e670c link true /test pull-verify

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-translation-status This PR does not have translation status info. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant