-
Notifications
You must be signed in to change notification settings - Fork 704
ticdc: clarify statements for DDLs #21866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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.
- [`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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 beALTER TABLE
. - Some links point to generic pages instead of more specific ones. For example, the link for
ALTER DATABASE CHARACTER SET
points to theALTER TABLE
documentation. Linking to the most specific documentation page provides a better user experience.
- [`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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
.
- 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: |
There was a problem hiding this 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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
?
@mjonss: adding LGTM is restricted to approvers and reviewers in OWNERS files. In 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)
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.
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?