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 description about ticdc new architecture #19765

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

Conversation

lidezhu
Copy link
Contributor

@lidezhu lidezhu commented Feb 10, 2025

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

@ti-chi-bot ti-chi-bot bot added missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 10, 2025
@lidezhu lidezhu changed the title ticdc: add new description about ticdc new architecture ticdc: add description about ticdc new architecture Feb 10, 2025
@qiancai qiancai self-requested a review February 10, 2025 09:18
@qiancai qiancai added area/ticdc Indicates that the Issue or PR belongs to the area of TiCDC. v9.0 labels Feb 10, 2025
@qiancai qiancai self-assigned this Feb 10, 2025
@qiancai qiancai added translation/doing This PR’s assignee is translating this PR. and removed missing-translation-status This PR does not have translation status info. labels Feb 10, 2025
Copy link

ti-chi-bot bot commented Feb 11, 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 ask for approval from qiancai, ensuring that each of them provides their approval before proceeding. 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

lidezhu and others added 2 commits February 11, 2025 11:14
Co-authored-by: Flowyi <flowbehappy@gmail.com>
Copy link

ti-chi-bot bot commented Feb 14, 2025

@wlwilliamx: 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.

@ti-chi-bot ti-chi-bot bot requested a review from flowbehappy February 14, 2025 08:35
Copy link
Contributor

@wlwilliamx wlwilliamx left a comment

Choose a reason for hiding this comment

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

Copy link

ti-chi-bot bot commented Feb 14, 2025

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

In response to this:

/CC @flowbehappy

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.

flowbehappy and others added 7 commits February 17, 2025 14:52
Co-authored-by: wlwilliamx <53336371+wlwilliamx@users.noreply.github.com>
Co-authored-by: wlwilliamx <53336371+wlwilliamx@users.noreply.github.com>
@lidezhu lidezhu force-pushed the ldz/add-ticdc-new-arch branch from 6de9f00 to 4a0d176 Compare February 17, 2025 13:11
Co-authored-by: Flowyi <flowbehappy@gmail.com>
Copy link

ti-chi-bot bot commented Feb 18, 2025

@flowbehappy: 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.

Copy link

ti-chi-bot bot commented Feb 18, 2025

@lidezhu: 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 23a82ec 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-sigs/prow repository. I understand the commands that are listed here.

Copy link
Contributor

@wlwilliamx wlwilliamx left a comment

Choose a reason for hiding this comment

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


![TiCDC New Architecture](/media/ticdc/ticdc-new-arch-2.jpg)

## 使用指南
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## 使用指南
## 新架构部署指南

Copy link
Contributor Author

Choose a reason for hiding this comment

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

“部署指南” 感觉应该足够了,不用再加 “新架构”

```

3. 参考[恢复同步任务](/ticdc/ticdc-manage-changefeed.md#恢复同步任务)恢复所有的 Changefeed 同步任务;

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## 新架构命令使用指南
在部署完新架构的节点之后,即可使用新架构的命令来操作新架构的 TiCDC 节点了。
新架构的使用命令与老架构采用的是同一套命令逻辑,需要注意的是要在命令中加上一个标志或者设置一个环境变量来让新架构的 TiCDC 节点执行命令。下面是使用方式的具体说明:
### 方式一:使用 `--newarch``-x` 标志
如果想让新架构的 TiCDC 节点执行某个命令,可以在命令中添加 `--newarch`(或 `-x`)标志。例如:
```
cdc --newarch cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task"
```
或使用 `-x` 的简写形式:
```
cdc -x cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task"
```
这样便可在新架构的 TiCDC 节点中创建 Changefeed。
如果不加 `--newarch``-x` 标志,将默认让老架构的 TiCDC 节点执行命令:
```
# 默认使用老架构
cdc cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task"
```
这样依旧是在老架构的 TiCDC 节点中创建 Changefeed。
### 方式二:使用 `TICDC_NEWARCH` 环境变量
若需要经常手动执行命令操作 TiCDC 新架构,可设置环境变量 `TICDC_NEWARCH=true`,这样当前终端会话中的所有 TiCDC 命令都会采用新架构。例如:
```
export TICDC_NEWARCH=true # 在当前终端会话中,之后所有的 TiCDC 命令都会采用新架构
# 现在默认使用的是新架构,在新架构 TiCDC 节点中创建 Changefeed
cdc cli changefeed create cdc cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task"
```
如果需要切换回老架构,可以取消该环境变量:
```
unset TICDC_NEWARCH
# 重新默认使用老架构,在老架构 TiCDC 节点中创建 Changefeed
cdc cli changefeed create cdc cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task"
```
### 常见命令示例
以下是一些 TiCDC 相关命令在新架构下的常见使用示例。
1. **在新架构的 TiCDC 节点中创建 Changefeed**
* 添加 `--newarch``-x` 标志:
```
cdc -x cli changefeed create cdc cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task"
```
* 设置 `TICDC_NEWARCH` 环境变量,后续该终端会话下的所有 TiCDC 命令都无需额外设置即可使用新架构:
```
export TICDC_NEWARCH=true
cdc cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task"
```
2. **查看 Changefeed 列表**
* 添加 `--newarch``-x` 标志:
```
cdc -x cli changefeed list --server=http://10.0.10.25:8300
```
* 设置 `TICDC_NEWARCH` 环境变量,后续该终端会话下的所有 TiCDC 命令都无需额外设置即可使用新架构:
```
export TICDC_NEWARCH=true
cdc cli changefeed list --server=http://10.0.10.25:8300
```
3. **暂停 Changefeed**
* 添加 `--newarch``-x` 标志:
```
cdc -x cli changefeed pause --server=http://10.0.10.25:8300 --changefeed-id simple-replication-task
```
* 设置 `TICDC_NEWARCH` 环境变量,后续该终端会话下的所有 TiCDC 命令都无需额外设置即可使用新架构:
```
export TICDC_NEWARCH=true
cdc cli changefeed pause --server=http://10.0.10.25:8300 --changefeed-id simple-replication-task
```
4. **恢复 Changefeed**
* 添加 `--newarch``-x` 标志:
```
cdc -x cli changefeed resume --server=http://10.0.10.25:8300 --changefeed-id simple-replication-task
```
* 设置 `TICDC_NEWARCH` 环境变量,后续该终端会话下的所有 TiCDC 命令都无需额外设置即可使用新架构:
```
export TICDC_NEWARCH=true
cdc cli changefeed resume --server=http://10.0.10.25:8300 --changefeed-id simple-replication-task
```
5. **删除 Changefeed**
* 添加 `--newarch``-x` 标志:
```
cdc -x cli changefeed remove --server=http://10.0.10.25:8300 --changefeed-id simple-replication-task
```
* 设置 `TICDC_NEWARCH` 环境变量,后续该终端会话下的所有 TiCDC 命令都无需额外设置即可使用新架构:
```
export TICDC_NEWARCH=true
cdc cli changefeed remove --server=http://10.0.10.25:8300 --changefeed-id simple-replication-task
```
6. **查询特定 Changefeed 信息**
* 添加 `--newarch``-x` 标志:
```
cdc -x cli changefeed query -s --server=http://10.0.10.25:8300 --changefeed-id=simple-replication-task
```
* 设置 `TICDC_NEWARCH` 环境变量,后续该终端会话下的所有 TiCDC 命令都无需额外设置即可使用新架构:
```
export TICDC_NEWARCH=true
cdc cli changefeed query -s --server=http://10.0.10.25:8300 --changefeed-id=simple-replication-task
```
7. **查看可用命令**
由于新架构仍在逐步完善,部分命令可能尚未支持。可以使用以下命令查看当前架构下的可用命令:
* 查看新架构当前支持的命令:
```
cdc --newarch help # 或者使用 -x
```
* 对比查看老架构当前支持的命令:
```
cdc help
```
在未来版本中,我们将逐步增加对 TiCDC 新架构更多命令的支持,请关注后续版本更新,以获取最新功能支持。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

”常见命令示例” 这一部分太冗长了,建议直接链接到老架构的操作指南的页面,再简单说明一下即可。

Copy link

ti-chi-bot bot commented Feb 18, 2025

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

In response to this:

@flowbehappy PTAL

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
area/ticdc Indicates that the Issue or PR belongs to the area of TiCDC. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. translation/doing This PR’s assignee is translating this PR. v9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants