From 521ffd958c298295a973a449bf9065be0042c138 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot <ti-community-prow-bot@tidb.io> Date: Thu, 14 Nov 2024 11:22:29 +0800 Subject: [PATCH] cdc: add description about compatibility with TiDB Lightning (#19392) (#19398) --- ticdc/ticdc-compatibility.md | 23 ++++++++++++++----- ...b-lightning-compatibility-and-scenarios.md | 2 ++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ticdc/ticdc-compatibility.md b/ticdc/ticdc-compatibility.md index f5e37e75a20f7..ff7673a002fc0 100644 --- a/ticdc/ticdc-compatibility.md +++ b/ticdc/ticdc-compatibility.md @@ -7,15 +7,26 @@ summary: Learn about compatibility issues of TiCDC and how to handle them. This section describes compatibility issues related to TiCDC and how to handle them. -<!-- -## component compatibility matrix +## Compatibility with TiDB Lightning -TODO +[TiDB Lightning](/tidb-lightning/tidb-lightning-overview.md) provides two data import modes: [logical import mode](/tidb-lightning/tidb-lightning-logical-import-mode.md) and [physical import mode](/tidb-lightning/tidb-lightning-physical-import-mode.md). This section describes the compatibility of these modes with TiCDC and the steps to use TiDB Lightning and TiCDC together in a cluster. -## feature compatibility matrix +In the logical import mode, TiDB Lightning imports data by executing SQL statements. This mode is compatible with TiCDC. To use TiDB Lightning's logical import mode with TiCDC for data replication, perform the following steps: -TODO ---> +1. Create a changefeed. For more information, see [Create a replication task](/ticdc/ticdc-manage-changefeed.md#create-a-replication-task). +2. Start TiDB Lightning and import data using the logical import mode. For more information, see [Use logical import mode](/tidb-lightning/tidb-lightning-logical-import-mode-usage.md). + +In the physical import mode, TiDB Lightning imports data by inserting SST files into TiKV. TiCDC is not compatible with this mode and does not support replicating data imported through physical import mode. If you need to use both TiDB Lightning's physical import mode and TiCDC, choose one of the following solutions based on your downstream system: + +- If the downstream is a TiDB cluster, perform the following steps: + + 1. Use TiDB Lightning to import data into both the upstream and downstream TiDB clusters to ensure data consistency. + 2. Create a changefeed to replicate subsequent incremental data written through SQL. For more information, see [Create a replication task](/ticdc/ticdc-manage-changefeed.md#create-a-replication-task). + +- If the downstream is not a TiDB cluster, perform the following steps: + + 1. Use the offline import tool provided by your downstream system to import TiDB Lightning's input files. + 2. Create a changefeed to replicate subsequent incremental data written through SQL. For more information, see [Create a replication task](/ticdc/ticdc-manage-changefeed.md#create-a-replication-task). ## CLI and configuration file compatibility diff --git a/tidb-lightning/tidb-lightning-compatibility-and-scenarios.md b/tidb-lightning/tidb-lightning-compatibility-and-scenarios.md index b01c240e29e24..6130dc96780ba 100644 --- a/tidb-lightning/tidb-lightning-compatibility-and-scenarios.md +++ b/tidb-lightning/tidb-lightning-compatibility-and-scenarios.md @@ -17,6 +17,8 @@ This document describes TiDB Lightning and [`IMPORT INTO`](/sql-statements/sql-s - TiDB Lightning [physical import mode](/tidb-lightning/tidb-lightning-physical-import-mode.md) is not compatible with log backup and TiCDC. The reason is that physical import mode directly ingests encoded KV pairs of the source data to TiKV, causing TiKV not to generate corresponding change logs during this process. Without such change logs, the relevant data cannot be backed up via log backup and cannot be replicated by TiCDC. +- To use TiDB Lightning and TiCDC together in a cluster, see [Compatibility with TiDB Lightning](/ticdc/ticdc-compatibility.md#compatibility-with-tidb-lightning). + - `IMPORT INTO` is not compatible with log backup and TiCDC. The reason is that `IMPORT INTO` also ingests encoded KV pairs of the source data directly to TiKV. ## Scenarios for TiDB Lightning logical import mode