From fbbeb7dbe7531932fe275ab0f118c7bbe49448bd Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Wed, 7 Feb 2024 11:31:14 +0800 Subject: [PATCH] ticdc: Add a description of the compatibility between BR and Lightning (#16451) --- ticdc/ticdc-faq.md | 14 +++++++++++++- ticdc/ticdc-overview.md | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ticdc/ticdc-faq.md b/ticdc/ticdc-faq.md index e787f61a5c72b..fe9c9f6315993 100644 --- a/ticdc/ticdc-faq.md +++ b/ticdc/ticdc-faq.md @@ -266,7 +266,19 @@ When upstream write traffic is at peak hours, the downstream may fail to consume ## Why does replication using TiCDC stall or even stop after data restore using TiDB Lightning and BR from upstream? -Currently, TiCDC is not yet fully compatible with TiDB Lightning and BR. Therefore, please avoid using TiDB Lightning and BR on tables that are replicated by TiCDC. +Currently, TiCDC is not yet fully compatible with TiDB Lightning and BR. Therefore, avoid using TiDB Lightning and BR on tables that are replicated by TiCDC. Otherwise, unknown errors might occur, such as TiCDC replication getting stuck, a significant spike in replication latency, or data loss. + +If you need to use TiDB Lightning or BR to restore data for some tables replicated by TiCDC, take these steps: + +1. Remove the TiCDC replication task related to these tables. + +2. Use TiDB Lightning or BR to restore data separately in the upstream and downstream clusters of TiCDC. + +3. After the restoration is complete and data consistency between the upstream and downstream clusters is verified, create a new TiCDC replication task for incremental replication, with the timestamp (TSO) from the upstream backup as the `start-ts` for the task. For example, assuming the snapshot timestamp of the BR backup in the upstream cluster is `431434047157698561`, you can create a new TiCDC replication task using the following command: + + ```shell + cdc cli changefeed create -c "upstream-to-downstream-some-tables" --start-ts=431434047157698561 --sink-uri="mysql://root@127.0.0.1:4000? time-zone=" + ``` ## After a changefeed resumes from pause, its replication latency gets higher and higher and returns to normal only after a few minutes. Why? diff --git a/ticdc/ticdc-overview.md b/ticdc/ticdc-overview.md index 3d162a297ac1a..094b8f1b35046 100644 --- a/ticdc/ticdc-overview.md +++ b/ticdc/ticdc-overview.md @@ -93,5 +93,6 @@ Currently, the following scenarios are not supported: - A TiKV cluster that uses RawKV alone. - The [`CREATE SEQUENCE` DDL operation](/sql-statements/sql-statement-create-sequence.md) and the [`SEQUENCE` function](/sql-statements/sql-statement-create-sequence.md#sequence-function) in TiDB. When the upstream TiDB uses `SEQUENCE`, TiCDC ignores `SEQUENCE` DDL operations/functions performed upstream. However, DML operations using `SEQUENCE` functions can be correctly replicated. +- Currently, performing [BR data recovery](/br/backup-and-restore-overview.md) and [TiDB Lightning](/tidb-lightning/tidb-lightning-overview.md) imports on tables and databases that are being replicated by TiCDC is not supported. For more information, see [Why does replication using TiCDC stall or even stop after data restore using TiDB Lightning and BR from upstream](/ticdc/ticdc-faq.md#why-does-replication-using-ticdc-stall-or-even-stop-after-data-restore-using-tidb-lightning-and-br-from-upstream). TiCDC only partially supports scenarios involving large transactions in the upstream. For details, refer to the [TiCDC FAQ](/ticdc/ticdc-faq.md#does-ticdc-support-replicating-large-transactions-is-there-any-risk), where you can find details on whether TiCDC supports replicating large transactions and any associated risks.