Skip to content
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

ticdc: add a faq about generated column #19035

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

wk989898
Copy link
Contributor

@wk989898 wk989898 commented Nov 11, 2024

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)
  • v8.5 (TiDB 8.5 versions)
  • v8.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 versions)
  • v8.2 (TiDB 8.2 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)
  • v5.3 (TiDB 5.3 versions)

What is the related PR or file 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

@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 Nov 11, 2024
Copy link

ti-chi-bot bot commented Nov 11, 2024

[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 lance6716 for approval. For more information see the Code Review Process.

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

@wk989898 wk989898 changed the title cdc: add a faq about generate column behaviour ticdc: add a faq about generated column Nov 11, 2024
Copy link

ti-chi-bot bot commented Nov 11, 2024

@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 9baac62 link true /test pull-verify

Full PR test history. Your PR dashboard.

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

@qiancai qiancai self-assigned this Nov 11, 2024
@qiancai qiancai added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Dec 3, 2024
@qiancai
Copy link
Collaborator

qiancai commented Dec 16, 2024

Hi @wk989898, would you please involve tech reviewers for this PR? Thanks.

Copy link
Collaborator

@qiancai qiancai left a comment

Choose a reason for hiding this comment

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

Rest LGTM

@@ -323,3 +323,11 @@ TiDB 有事务超时的机制,当事务运行超过 [`max-txn-ttl`](/tidb-conf
}
]
```

## DML 中的生成列会发生什么行为?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
## DML 中的生成列会发生什么行为
## TiCDC 会同步 DML 操作中的生成列吗


## DML 中的生成列会发生什么行为?

生成列包括存储生成列和虚拟生成列。TICDC 会忽略虚拟生成列,而仅复制存储生成列到下游。当下游是 MySQL 数据库或其他与 MySQL 兼容的数据库,而不是 Kakfa 或其他存储服务时,存储生成列也会被忽略。
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
生成列包括存储生成列和虚拟生成列。TICDC 会忽略虚拟生成列,而仅复制存储生成列到下游。当下游是 MySQL 数据库或其他与 MySQL 兼容的数据库,而不是 Kakfa 或其他存储服务时,存储生成列也会被忽略。
生成列包括虚拟生成列和存储生成列。TiCDC 会忽略虚拟生成列,而仅同步存储生成列到下游。当下游是 MySQL 或其他与 MySQL 兼容的数据库,而不是 Kakfa 或其他存储服务时,存储生成列也会被忽略。

Comment on lines +331 to +333
> **Note:**
>
> 当复制存储生成列到 Kafka 或存储服务后,再写回 MySQL 时,可能会发生错误 `Error 3105 (HY000): The value specified for generated column 'xx' in table 'xxx' is not allowed`。您可以使用[Open Protocol](https://docs.pingcap.com/zh/tidb/stable/ticdc-open-protocol#ticdc-open-protocol)来避免此错误,因为该协议携带 column flag, 可以区分是否为生成列。
Copy link
Collaborator

@qiancai qiancai Dec 24, 2024

Choose a reason for hiding this comment

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

Suggested change
> **Note:**
>
> 当复制存储生成列到 Kafka 或存储服务后,再写回 MySQL 时,可能会发生错误 `Error 3105 (HY000): The value specified for generated column 'xx' in table 'xxx' is not allowed`。您可以使用[Open Protocol]https://docs.pingcap.com/zh/tidb/stable/ticdc-open-protocol#ticdc-open-protocol)来避免此错误,因为该协议携带 column flag, 可以区分是否为生成列。
> **注意:**
>
> 当同步存储生成列到 Kafka 或存储服务后,再将其写回 MySQL 时,可能会遇到 `Error 3105 (HY000): The value specified for generated column 'xx' in table 'xxx' is not allowed` 错误。为避免该错误,你可以使用 [Open Protocol](/ticdc/ticdc-open-protocol.md#ticdc-open-protocol) 进行同步。该协议的输出包含[列的 flag](/ticdc/ticdc-open-protocol.md#列标志位)可以区分是否为生成列。

Copy link

ti-chi-bot bot commented Dec 24, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-24 07:15:12.636273269 +0000 UTC m=+1545902.725075797: ☑️ agreed by qiancai.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 24, 2024
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. needs-1-more-lgtm Indicates a PR needs 1 more LGTM. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. 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.

2 participants