From 8d441a546f29d69a4cc71fcd02a13372ceb00ae8 Mon Sep 17 00:00:00 2001 From: doc-claw-bot Date: Thu, 24 Sep 2026 14:35:41 +0000 Subject: [PATCH 1/3] ticdc: clarify scheduler.write-key-threshold across architectures --- ticdc/ticdc-architecture.md | 13 ++++++++++--- ticdc/ticdc-changefeed-config.md | 9 ++++++--- ticdc/ticdc-sink-to-kafka.md | 14 ++++++++------ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/ticdc/ticdc-architecture.md b/ticdc/ticdc-architecture.md index cb7ddd604c17a..1b9e02f52efe8 100644 --- a/ticdc/ticdc-architecture.md +++ b/ticdc/ticdc-architecture.md @@ -60,7 +60,7 @@ The new architecture supports **table-level task splitting** for all sinks. You When this feature is enabled, TiCDC automatically splits and distributes tables across multiple nodes for parallel replication if those tables meet any of the following conditions. This improves replication efficiency and resource utilization: - The table Region count exceeds the configured threshold (`10000` by default, adjustable via `scheduler.region-threshold`). -- The table write traffic exceeds the configured threshold (disabled by default, configurable via `scheduler.write-key-threshold`). +- The table sink DML event throughput exceeds the configured threshold (disabled by default, configurable via `scheduler.write-key-threshold`, measured in bytes per second). > **Note:** > @@ -74,7 +74,7 @@ In table split mode, pay attention to the following settings: - [`scheduler.region-threshold`](/ticdc/ticdc-changefeed-config.md#region-threshold): the default value is `10000`. When the number of Regions in a table exceeds this threshold, TiCDC splits the table. For tables with relatively few Regions but high overall write throughput, you can reduce this value appropriately. This parameter must be greater than or equal to `scheduler.region-count-per-span`. Otherwise, tasks might be rescheduled repeatedly, which increases replication latency. - [`scheduler.region-count-per-span`](/ticdc/ticdc-changefeed-config.md#region-count-per-span-new-in-v854): the default value is `100`. During changefeed initialization, TiCDC splits tables that meet the split conditions according to this parameter. After splitting, each sub-table contains at most `region-count-per-span` Regions. -- [`scheduler.write-key-threshold`](/ticdc/ticdc-changefeed-config.md#write-key-threshold): the default value is `0` (disabled). When the sink write throughput of a table exceeds this threshold, TiCDC triggers table splitting. In most cases, keep this parameter at `0`. +- [`scheduler.write-key-threshold`](/ticdc/ticdc-changefeed-config.md#write-key-threshold): the default value is `0` (disabled). In the new architecture, this value is measured in sink DML event bytes per second. If you set a positive value smaller than `10485760` (10 MiB), TiCDC automatically adjusts it to `10485760`. In most cases, keep this parameter at `0`. ## Compatibility @@ -109,7 +109,14 @@ In the TiCDC classic architecture, DDL replication operations are strictly seria ## Limitations -The new TiCDC architecture currently does not support splitting large transactions into multiple batches for downstream replication. As a result, there is still a risk of OOM when processing extremely large transactions. Make sure to evaluate and mitigate this risk appropriately before using the new architecture. +The new TiCDC architecture incorporates all functionalities of the classic architecture. However, some features have not yet been fully tested. To ensure system stability, it is **NOT** recommended to use the following features in core production environments: + +- [Syncpoint](/ticdc/ticdc-upstream-downstream-check.md) +- [Redo Log](/ticdc/ticdc-sink-to-mysql.md#eventually-consistent-replication-in-disaster-scenarios) +- [Pulsar Sink](/ticdc/ticdc-sink-to-pulsar.md) +- [Storage Sink](/ticdc/ticdc-sink-to-cloud-storage.md) + +In addition, the new TiCDC architecture currently does not support splitting large transactions into multiple batches for downstream replication. As a result, there is still a risk of OOM when processing extremely large transactions. Make sure to evaluate and mitigate this risk appropriately before using the new architecture. ## Upgrade guide diff --git a/ticdc/ticdc-changefeed-config.md b/ticdc/ticdc-changefeed-config.md index a1176ae05177f..a68b8bac6e998 100644 --- a/ticdc/ticdc-changefeed-config.md +++ b/ticdc/ticdc-changefeed-config.md @@ -156,7 +156,7 @@ For more information, see [Event filter rules](/ticdc/ticdc-filter.md#event-filt - When `enable-table-across-nodes` is enabled, there are two allocation modes: 1. Allocate tables based on the number of Regions, so that each TiCDC node handles roughly the same number of Regions. If the number of Regions for a table exceeds the value of [`region-threshold`](#region-threshold), the table will be allocated to multiple nodes for replication. - 2. Allocate tables based on the write traffic, so that each TiCDC node handles roughly the same number of modified rows. Only when the number of modified rows per minute in a table exceeds the value of [`write-key-threshold`](#write-key-threshold), will this allocation take effect. + 2. Allocate tables based on the write traffic, so that each TiCDC node handles a similar amount of write load. In the [TiCDC classic architecture](/ticdc/ticdc-classic-architecture.md), this mode uses the upstream PD Region `written_keys` statistics. In the [TiCDC new architecture](/ticdc/ticdc-architecture.md), this mode uses the sink DML event size per second. Only when a table's write traffic exceeds the value of [`write-key-threshold`](#write-key-threshold), will this allocation take effect. You only need to configure one of the two modes. If both `region-threshold` and `write-key-threshold` are configured, TiCDC prioritizes the traffic allocation mode, namely `write-key-threshold`. @@ -174,7 +174,9 @@ For more information, see [Event filter rules](/ticdc/ticdc-filter.md#event-filt #### `write-key-threshold` -- Default value: `0`, which means that the traffic allocation mode is not used by default +- Default value: `0`, which disables traffic-based allocation by default. +- In the [TiCDC new architecture](/ticdc/ticdc-architecture.md), this value is measured in sink DML event bytes per second. When `scheduler.enable-table-across-nodes = true`, any positive value smaller than `10485760` (10 MiB) is automatically adjusted to `10485760`. +- In the [TiCDC classic architecture](/ticdc/ticdc-classic-architecture.md), this value is the threshold for the upstream PD Region `written_keys` statistics used by classic table splitting. ### sink @@ -182,9 +184,10 @@ For more information, see [Event filter rules](/ticdc/ticdc-filter.md#event-filt #### `dispatchers` -- When the changefeed downstream is an MQ sink, you can use `dispatchers` to configure event dispatchers. Starting from v8.5.7, for the [new TiCDC architecture](/ticdc/ticdc-architecture.md), you can also use `dispatchers` to configure table routing, mapping upstream tables to specific downstream database or table names. For more information, see [TiCDC table routing](/ticdc/ticdc-table-routing.md). +- For the sink of MQ type, you can use dispatchers to configure the event dispatcher. - Starting from v6.1.0, TiDB supports two types of event dispatchers: partition and topic. - The matching syntax of matcher is the same as the filter rule syntax. +- This configuration item only takes effect if the downstream is MQ. - When the downstream MQ is Pulsar, if the routing rule for `partition` is not specified as any of `ts`, `index-value`, `table`, or `default`, each Pulsar message will be routed using the string you set as the key. For example, if you specify the routing rule for a matcher as the string `code`, then all Pulsar messages that match that matcher will be routed with `code` as the key. #### `column-selectors` New in v7.5.0 diff --git a/ticdc/ticdc-sink-to-kafka.md b/ticdc/ticdc-sink-to-kafka.md index e02db4b69c604..99cda6f7e28e4 100644 --- a/ticdc/ticdc-sink-to-kafka.md +++ b/ticdc/ticdc-sink-to-kafka.md @@ -352,7 +352,7 @@ column-selectors = [ ## Scale out the load of a single large table to multiple TiCDC nodes -This feature splits the data replication range of a single large table into multiple ranges, according to the data volume and the number of modified rows per minute, and it makes the data volume and the number of modified rows replicated in each range approximately the same. This feature distributes these ranges to multiple TiCDC nodes for replication, so that multiple TiCDC nodes can replicate a large single table at the same time. This feature can solve the following two problems: +This feature splits the data replication range of a single large table into multiple ranges and distributes them to multiple TiCDC nodes for parallel replication. TiCDC can split a table when its Region count exceeds `region-threshold` or when its write traffic exceeds `write-key-threshold`. In the TiCDC classic architecture, `write-key-threshold` uses the upstream PD Region `written_keys` statistics. In the TiCDC new architecture, `write-key-threshold` uses sink DML event bytes per second. This feature can solve the following two problems: - A single TiCDC node cannot replicate a large single table in time. - The resources (such as CPU and memory) consumed by TiCDC nodes are not evenly distributed. @@ -370,14 +370,16 @@ enable-table-across-nodes = true # When you enable this feature, it only takes effect for tables with the number of regions greater than the `region-threshold` value. For the TiCDC new architecture, the default value is `10000`; for the TiCDC classic architecture, the default value is `100000`. region-threshold = 10000 -# When you enable this feature, it takes effect for tables with the number of rows modified per minute greater than the `write-key-threshold` value. +# When you enable this feature, it takes effect for tables whose write traffic exceeds the `write-key-threshold` value. # Note: -# * The default value of `write-key-threshold` is 0, which means that the feature does not split the table replication range according to the number of rows modified in a table by default. -# * You can configure this parameter according to your cluster workload. For example, if it is configured as 30000, it means that the feature will split the replication range of a table when the number of modified rows per minute in the table exceeds 30000. +# * The default value of `write-key-threshold` is 0, which disables traffic-based table splitting by default. +# * In the TiCDC classic architecture, `write-key-threshold` uses the upstream PD Region `written_keys` statistics. +# * In the TiCDC new architecture, `write-key-threshold` is measured in sink DML event bytes per second. If you set a positive value smaller than 10485760 (10 MiB), TiCDC automatically adjusts it to 10485760, so do not reuse classic-architecture values directly. +# * In the TiCDC new architecture, 10485760 (10 MiB) is the smallest positive value that takes effect without adjustment. # * When `region-threshold` and `write-key-threshold` are configured at the same time: -# TiCDC will check whether the number of modified rows is greater than `write-key-threshold` first. +# TiCDC will check whether the write traffic is greater than `write-key-threshold` first. # If not, next check whether the number of Regions is greater than `region-threshold`. -write-key-threshold = 30000 +write-key-threshold = 10485760 ``` You can query the number of Regions a table contains by the following SQL statement: From 7ff8f4e2a00a7c456c8c51596db9f644aadb9b95 Mon Sep 17 00:00:00 2001 From: qiancai Date: Wed, 21 Oct 2026 18:37:42 +0800 Subject: [PATCH 2/3] sync from docs-cn pr --- ticdc/ticdc-architecture.md | 2 +- ticdc/ticdc-sink-to-kafka.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ticdc/ticdc-architecture.md b/ticdc/ticdc-architecture.md index 1b9e02f52efe8..2847ad4feb9bd 100644 --- a/ticdc/ticdc-architecture.md +++ b/ticdc/ticdc-architecture.md @@ -74,7 +74,7 @@ In table split mode, pay attention to the following settings: - [`scheduler.region-threshold`](/ticdc/ticdc-changefeed-config.md#region-threshold): the default value is `10000`. When the number of Regions in a table exceeds this threshold, TiCDC splits the table. For tables with relatively few Regions but high overall write throughput, you can reduce this value appropriately. This parameter must be greater than or equal to `scheduler.region-count-per-span`. Otherwise, tasks might be rescheduled repeatedly, which increases replication latency. - [`scheduler.region-count-per-span`](/ticdc/ticdc-changefeed-config.md#region-count-per-span-new-in-v854): the default value is `100`. During changefeed initialization, TiCDC splits tables that meet the split conditions according to this parameter. After splitting, each sub-table contains at most `region-count-per-span` Regions. -- [`scheduler.write-key-threshold`](/ticdc/ticdc-changefeed-config.md#write-key-threshold): the default value is `0` (disabled). In the new architecture, this value is measured in sink DML event bytes per second. If you set a positive value smaller than `10485760` (10 MiB), TiCDC automatically adjusts it to `10485760`. In most cases, keep this parameter at `0`. +- [`scheduler.write-key-threshold`](/ticdc/ticdc-changefeed-config.md#write-key-threshold): the default value is `0` (disabled). In the new architecture, this value is measured in sink DML event bytes per second. When `scheduler.enable-table-across-nodes = true`, if you set a positive value smaller than `10485760` (10 MiB), TiCDC automatically adjusts it to `10485760`. In most cases, keep this parameter at `0`. ## Compatibility diff --git a/ticdc/ticdc-sink-to-kafka.md b/ticdc/ticdc-sink-to-kafka.md index 99cda6f7e28e4..935c4d1c468eb 100644 --- a/ticdc/ticdc-sink-to-kafka.md +++ b/ticdc/ticdc-sink-to-kafka.md @@ -352,7 +352,7 @@ column-selectors = [ ## Scale out the load of a single large table to multiple TiCDC nodes -This feature splits the data replication range of a single large table into multiple ranges and distributes them to multiple TiCDC nodes for parallel replication. TiCDC can split a table when its Region count exceeds `region-threshold` or when its write traffic exceeds `write-key-threshold`. In the TiCDC classic architecture, `write-key-threshold` uses the upstream PD Region `written_keys` statistics. In the TiCDC new architecture, `write-key-threshold` uses sink DML event bytes per second. This feature can solve the following two problems: +This feature splits the data replication range of a single large table into multiple ranges and distributes them to multiple TiCDC nodes for parallel replication. When this feature is enabled, TiCDC can split the replication range based on the number of Regions in the table. When `write-key-threshold` is greater than `0`, TiCDC can also split the replication range based on write traffic. In the TiCDC classic architecture, `write-key-threshold` uses the upstream PD Region `written_keys` statistics. In the TiCDC new architecture, `write-key-threshold` uses sink DML event bytes per second. This feature can solve the following two problems: - A single TiCDC node cannot replicate a large single table in time. - The resources (such as CPU and memory) consumed by TiCDC nodes are not evenly distributed. From 26b51012cbc857c1d29c628b18c29478785153f8 Mon Sep 17 00:00:00 2001 From: qiancai Date: Fri, 4 Dec 2026 21:07:12 +0800 Subject: [PATCH 3/3] ticdc: clarify write traffic threshold semantics --- ticdc/ticdc-architecture.md | 4 +++- ticdc/ticdc-changefeed-config.md | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ticdc/ticdc-architecture.md b/ticdc/ticdc-architecture.md index 2847ad4feb9bd..ab9591c89529b 100644 --- a/ticdc/ticdc-architecture.md +++ b/ticdc/ticdc-architecture.md @@ -74,7 +74,9 @@ In table split mode, pay attention to the following settings: - [`scheduler.region-threshold`](/ticdc/ticdc-changefeed-config.md#region-threshold): the default value is `10000`. When the number of Regions in a table exceeds this threshold, TiCDC splits the table. For tables with relatively few Regions but high overall write throughput, you can reduce this value appropriately. This parameter must be greater than or equal to `scheduler.region-count-per-span`. Otherwise, tasks might be rescheduled repeatedly, which increases replication latency. - [`scheduler.region-count-per-span`](/ticdc/ticdc-changefeed-config.md#region-count-per-span-new-in-v854): the default value is `100`. During changefeed initialization, TiCDC splits tables that meet the split conditions according to this parameter. After splitting, each sub-table contains at most `region-count-per-span` Regions. -- [`scheduler.write-key-threshold`](/ticdc/ticdc-changefeed-config.md#write-key-threshold): the default value is `0` (disabled). In the new architecture, this value is measured in sink DML event bytes per second. When `scheduler.enable-table-across-nodes = true`, if you set a positive value smaller than `10485760` (10 MiB), TiCDC automatically adjusts it to `10485760`. In most cases, keep this parameter at `0`. +- [`scheduler.write-key-threshold`](/ticdc/ticdc-changefeed-config.md#write-key-threshold): sets the threshold for splitting table replication tasks based on the write traffic of a table. The default value is `0`, which disables splitting table replication tasks based on write traffic. The write traffic of a table is calculated from the estimated size of DML events that the sink has finished writing, measured in bytes per second. In most cases, keep this parameter at `0`. + - When `scheduler.enable-table-across-nodes = true`, if you set `scheduler.write-key-threshold` to a positive value smaller than `10485760`, TiCDC automatically adjusts it to `10485760`, using 10 MiB/s as the write traffic threshold. + - When `scheduler.enable-table-across-nodes = true`, if you set `scheduler.write-key-threshold` to a value greater than or equal to `10485760`, TiCDC uses the configured value as the write traffic threshold. ## Compatibility diff --git a/ticdc/ticdc-changefeed-config.md b/ticdc/ticdc-changefeed-config.md index a68b8bac6e998..383ef5d0cf14f 100644 --- a/ticdc/ticdc-changefeed-config.md +++ b/ticdc/ticdc-changefeed-config.md @@ -174,8 +174,10 @@ For more information, see [Event filter rules](/ticdc/ticdc-filter.md#event-filt #### `write-key-threshold` -- Default value: `0`, which disables traffic-based allocation by default. -- In the [TiCDC new architecture](/ticdc/ticdc-architecture.md), this value is measured in sink DML event bytes per second. When `scheduler.enable-table-across-nodes = true`, any positive value smaller than `10485760` (10 MiB) is automatically adjusted to `10485760`. +- Default value: `0`, which disables splitting table replication tasks based on write traffic. +- In the [TiCDC new architecture](/ticdc/ticdc-architecture.md), this parameter sets the threshold for splitting table replication tasks based on the write traffic of a table. The write traffic of a table is calculated from the estimated size of DML events that the sink has finished writing, measured in bytes per second. In most cases, keep this parameter at `0`. + - When `scheduler.enable-table-across-nodes = true`, if you set `scheduler.write-key-threshold` to a positive value smaller than `10485760`, TiCDC automatically adjusts it to `10485760`, using 10 MiB/s as the write traffic threshold. + - When `scheduler.enable-table-across-nodes = true`, if you set `scheduler.write-key-threshold` to a value greater than or equal to `10485760`, TiCDC uses the configured value as the write traffic threshold. - In the [TiCDC classic architecture](/ticdc/ticdc-classic-architecture.md), this value is the threshold for the upstream PD Region `written_keys` statistics used by classic table splitting. ### sink