Skip to content

Describe TiCDC support in TiFlash #20012

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

Merged
merged 11 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ticdc/ticdc-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ summary: 了解 TiCDC 兼容性相关限制和问题处理。
1. 使用下游系统提供的离线导入工具,将 TiDB Lightning 的输入文件导入到下游系统。
2. 创建 changefeed,用于同步后续通过 SQL 写入的增量数据。详情参考[创建同步任务](/ticdc/ticdc-manage-changefeed.md#创建同步任务)。

## TiCDC 与 TiFlash 的兼容性

目前,使用 TiCDC 同步表到下游 TiDB 集群时,不支持为表创建 TiFlash 副本,即 TiCDC 不支持同步 TiFlash 相关的 DDL,例如:

* `ALTER TABLE table_name SET TIFLASH REPLICA count;`
* `ALTER DATABASE db_name SET TIFLASH REPLICA count;`

## 命令行参数和配置文件兼容性

* TiCDC v4.0.0 中移除了 `ignore-txn-commit-ts`,添加了 `ignore-txn-start-ts`,使用 start_ts 过滤事务。
Expand Down
9 changes: 9 additions & 0 deletions tiflash/create-tiflash-replicas.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ ALTER TABLE `tpch50`.`lineitem` SET TIFLASH REPLICA 0;

* v5.1 版本及后续版本将不再支持设置系统表的 replica。在集群升级前,需要清除相关系统表的 replica,否则升级到较高版本后将无法再修改系统表的 replica 设置。

> **注意:**
>
> 目前,使用 TiCDC 同步表到下游 TiDB 集群时,不支持为表创建 TiFlash 副本,即 TiCDC 不支持同步 TiFlash 相关的 DDL,例如:
>
> * `ALTER TABLE table_name SET TIFLASH REPLICA count;`
> * `ALTER DATABASE db_name SET TIFLASH REPLICA count;`

### 查看表同步进度

可通过如下 SQL 语句查看特定表(通过 WHERE 语句指定,去掉 WHERE 语句则查看所有表)的 TiFlash 副本的状态:
Expand Down Expand Up @@ -102,6 +109,8 @@ ALTER DATABASE `tpch50` SET TIFLASH REPLICA 0;
> - 该命令执行结束后,在该库中新建的表不会自动创建 TiFlash 副本。
>
> - 该命令会跳过系统表、视图、临时表以及包含了 TiFlash 不支持字符集的表。
>
> - 通过设置 [`tidb_batch_pending_tiflash_count`](/system-variables.md#tidb_batch_pending_tiflash_count-从-v60-版本开始引入) 系统变量可以控制执行过程中允许的尚未同步完成的表的数量。调小该值有助于减低同步时集群受到的压力。注意,因为这个限制不是实时的,所以设置完后仍有可能存在尚未同步完成的表的数量超过限制的情况。

### 查看库同步进度

Expand Down