Skip to content

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Oct 3, 2025

First-time contributors' checklist

What is changed, added or deleted? (Required)

  • Sort the list
  • Link to statement docs
  • replace things that aren't statements with actual statements

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.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 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)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

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

  • This PR is translated from:
  • Other reference link(s):

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

Copy link

ti-chi-bot bot commented Oct 3, 2025

[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 csuzhangxc 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.

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 the missing-translation-status This PR does not have translation status info. label Oct 3, 2025
Copy link

Summary of Changes

Hello @dveeden, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the documentation for DDL statements within TiCDC's bidirectional replication feature. It clarifies which DDLs are replicable and non-replicable by providing direct links to their detailed SQL statement documentation, making it easier for users to understand their behavior. The changes also involve reordering and updating the lists of DDLs for better organization and accuracy, alongside minor formatting and typo corrections.

Highlights

  • Documentation Clarity: Enhanced clarity for DDL statements in TiCDC bidirectional replication documentation by adding direct links to SQL statement definitions.
  • DDL List Refinement: Refined and reordered the lists of replicable and non-replicable DDLs for improved accuracy and readability, including the addition of new DDLs like CREATE INDEX and ALTER TABLE ... AUTO_INCREMENT.
  • Formatting and Typo Fixes: Corrected a minor formatting issue within a code block and a typo in a DDL statement (ATLER TABLE to ALTER TABLE).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ti-chi-bot ti-chi-bot bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 3, 2025
@dveeden dveeden requested review from hfxsd, mjonss and qiancai October 3, 2025 11:26
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request does a great job of clarifying the replicable and non-replicable DDL statements for bidirectional replication by using more specific syntax and adding links to relevant documentation. The changes significantly improve clarity. I've identified a couple of minor areas for improvement, including a typo and opportunities to enhance link consistency, and have provided suggestions to address them.

Comment on lines 73 to 85
- [`ALTER DATABASE CHARACTER SET`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... ADD COLUMN`](/sql-statements/sql-statement-alter-table.md): the column is `not null` and does not have a `default value`
- [`ALTER TABLE ... ADD PRIMARY KEY`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... ADD UNIQUE INDEX`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... AUTO_INCREMENT=...`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... AUTO_RANDOM_BASE=...`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... CHARACTER SET=...`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... DROP COLUMN`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... DROP PARTITION`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... EXCHANGE PARTITION`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... MODIFY COLUMN`](/sql-statements/sql-statement-modify-column.md): you can modify the attributes of the column except `default value` and `comment`
- [`ALTER TABLE ... REORGANIZE PARTITION`](/sql-statements/sql-statement-alter-table.md)
- [`ATLER TABLE ... TRUNCATE PARTITION`](/sql-statements/sql-statement-alter-table.md)

Choose a reason for hiding this comment

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

low

The list of non-replicable DDLs has a few issues that can be improved for accuracy and consistency:

  • There is a typo: ATLER TABLE should be ALTER TABLE.
  • Some links point to generic pages instead of more specific ones. For example, the link for ALTER DATABASE CHARACTER SET points to the ALTER TABLE documentation. Linking to the most specific documentation page provides a better user experience.
Suggested change
- [`ALTER DATABASE CHARACTER SET`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... ADD COLUMN`](/sql-statements/sql-statement-alter-table.md): the column is `not null` and does not have a `default value`
- [`ALTER TABLE ... ADD PRIMARY KEY`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... ADD UNIQUE INDEX`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... AUTO_INCREMENT=...`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... AUTO_RANDOM_BASE=...`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... CHARACTER SET=...`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... DROP COLUMN`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... DROP PARTITION`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... EXCHANGE PARTITION`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... MODIFY COLUMN`](/sql-statements/sql-statement-modify-column.md): you can modify the attributes of the column except `default value` and `comment`
- [`ALTER TABLE ... REORGANIZE PARTITION`](/sql-statements/sql-statement-alter-table.md)
- [`ATLER TABLE ... TRUNCATE PARTITION`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER DATABASE CHARACTER SET`](/sql-statements/sql-statement-alter-database.md)
- [`ALTER TABLE ... ADD COLUMN`](/sql-statements/sql-statement-add-column.md): the column is `not null` and does not have a `default value`
- [`ALTER TABLE ... ADD PRIMARY KEY`](/sql-statements/sql-statement-add-index.md)
- [`ALTER TABLE ... ADD UNIQUE INDEX`](/sql-statements/sql-statement-add-index.md)
- [`ALTER TABLE ... AUTO_INCREMENT=...`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... AUTO_RANDOM_BASE=...`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... CHARACTER SET=...`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... DROP COLUMN`](/sql-statements/sql-statement-drop-column.md)
- [`ALTER TABLE ... DROP PARTITION`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... EXCHANGE PARTITION`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... MODIFY COLUMN`](/sql-statements/sql-statement-modify-column.md): you can modify the attributes of the column except `default value` and `comment`
- [`ALTER TABLE ... REORGANIZE PARTITION`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... TRUNCATE PARTITION`](/sql-statements/sql-statement-alter-table.md)

> Do not set the BDR role in other scenarios, for example, setting `PRIMARY`, `SECONDARY`, and no BDR roles at the same time. If you set the BDR role incorrectly, TiDB cannot guarantee data correctness and consistency during data replication.

- Usually do not use `AUTO_INCREMENT` or `AUTO_RANDOM` to avoid data conflicts in the replicated tables. If you need to use `AUTO_INCREMENT` or `AUTO_RANDOM`, you can set different `auto_increment_increment` and `auto_increment_offset` for different clusters to ensure that different clusters can be assigned different primary keys. For example, if there are three TiDB clusters (A, B, and C) in bi-directional replication, you can set them as follows:
- Usually do not use [`AUTO_INCREMENT`](/auto_increment.md) or `AUTO_RANDOM` to avoid data conflicts in the replicated tables. If you need to use `AUTO_INCREMENT` or `AUTO_RANDOM`, you can set different `auto_increment_increment` and `auto_increment_offset` for different clusters to ensure that different clusters can be assigned different primary keys. For example, if there are three TiDB clusters (A, B, and C) in bi-directional replication, you can set them as follows:

Choose a reason for hiding this comment

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

low

It's great that you've added a link for AUTO_INCREMENT. For consistency and to provide more context to the user, consider also adding a link for AUTO_RANDOM.

Suggested change
- Usually do not use [`AUTO_INCREMENT`](/auto_increment.md) or `AUTO_RANDOM` to avoid data conflicts in the replicated tables. If you need to use `AUTO_INCREMENT` or `AUTO_RANDOM`, you can set different `auto_increment_increment` and `auto_increment_offset` for different clusters to ensure that different clusters can be assigned different primary keys. For example, if there are three TiDB clusters (A, B, and C) in bi-directional replication, you can set them as follows:
- Usually do not use [`AUTO_INCREMENT`](/auto_increment.md) or [`AUTO_RANDOM`](/auto-random.md) to avoid data conflicts in the replicated tables. If you need to use `AUTO_INCREMENT` or `AUTO_RANDOM`, you can set different `auto_increment_increment` and `auto_increment_offset` for different clusters to ensure that different clusters can be assigned different primary keys. For example, if there are three TiDB clusters (A, B, and C) in bi-directional replication, you can set them as follows:

Copy link
Contributor

@mjonss mjonss left a comment

Choose a reason for hiding this comment

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

LGTM

- [`ALTER TABLE REMOVE TTL`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE TTL`](/sql-statements/sql-statement-alter-table.md)
- [`CREATE DATABASE`](/sql-statements/sql-statement-create-database.md)
- [`CREATE INDEX`](/sql-statements/sql-statement-create-index.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this also have (non-unique)?

- [`ALTER DATABASE CHARACTER SET`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... ADD COLUMN`](/sql-statements/sql-statement-alter-table.md): the column is `not null` and does not have a `default value`
- [`ALTER TABLE ... ADD PRIMARY KEY`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE ... ADD UNIQUE INDEX`](/sql-statements/sql-statement-alter-table.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also list CREATE UNIQUE INDEX?

Copy link

ti-chi-bot bot commented Oct 3, 2025

@mjonss: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

LGTM

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.

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/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants