TiCDC Compatibility
This section describes compatibility issues related to TiCDC and how to handle them.
Compatibility with TiDB Lightning
TiDB Lightning provides two data import modes: logical import mode and physical import mode. This section describes the compatibility of these modes with TiCDC and the steps to use TiDB Lightning and TiCDC together in a cluster.
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:
- Create a changefeed. For more information, see Create a replication task.
- Start TiDB Lightning and import data using the logical import mode. For more information, see Use logical import mode.
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:
- Use TiDB Lightning to import data into both the upstream and downstream TiDB clusters to ensure data consistency.
- Create a changefeed to replicate subsequent incremental data written through SQL. For more information, see Create a replication task.
If the downstream is not a TiDB cluster, perform the following steps:
- Use the offline import tool provided by your downstream system to import TiDB Lightning's input files.
- Create a changefeed to replicate subsequent incremental data written through SQL. For more information, see Create a replication task.
Compatibility with TiFlash
Currently, when you use TiCDC to replicate tables to a downstream TiDB cluster, creating TiFlash replicas for the tables is not supported, which means that TiCDC does not support replicating TiFlash-related DDL statements, such as:
ALTER TABLE table_name SET TIFLASH REPLICA count;ALTER DATABASE db_name SET TIFLASH REPLICA count;
CLI and configuration file compatibility
- In TiCDC v4.0.0,
ignore-txn-commit-tsis removed andignore-txn-start-tsis added, which uses start_ts to filter transactions. - In TiCDC v4.0.2,
db-dbs/db-tables/ignore-dbs/ignore-tablesare removed andrulesis added, which uses new filter rules for databases and tables. For detailed filter syntax, see Table Filter. - Starting from TiCDC v6.2.0,
cdc clican directly interact with TiCDC server via TiCDC Open API. You can specify the address of the TiCDC server using the--serverparameter.--pdis deprecated. - Since v6.4.0, only the changefeed with the
SYSTEM_VARIABLES_ADMINorSUPERprivilege can use the TiCDC Syncpoint feature.
Handle compatibility issues
This section describes compatibility issues related to TiCDC and how to handle them.
Incompatibility issue caused by using the TiCDC v5.0.0-rc cdc cli tool to operate a v4.0.x cluster
When using the cdc cli tool of TiCDC v5.0.0-rc to operate a v4.0.x TiCDC cluster, you might encounter the following abnormal situations:
If the TiCDC cluster is v4.0.8 or an earlier version, using the v5.0.0-rc
cdc clitool to create a replication task might cause cluster anomalies and get the replication task stuck.If the TiCDC cluster is v4.0.9 or a later version, using the v5.0.0-rc
cdc clitool to create a replication task will cause the old value and unified sorter features to be unexpectedly enabled by default.
Solutions:
Use the cdc executable file corresponding to the TiCDC cluster version to perform the following operations:
- Delete the changefeed created using the v5.0.0-rc
cdc clitool. For example, run thetiup cdc:v4.0.9 cli changefeed remove -c xxxx --pd=xxxxx --forcecommand. - If the replication task is stuck, restart the TiCDC cluster. For example, run the
tiup cluster restart <cluster_name> -R cdccommand. - Re-create the changefeed. For example, run the
tiup cdc:v4.0.9 cli changefeed create --sink-uri=xxxx --pd=xxxcommand.
Compatibility notes for sort-dir and data-dir
The sort-dir configuration is used to specify the temporary file directory for the TiCDC sorter. Its functionalities might vary in different versions. The following table lists sort-dir's compatibility changes across versions.
Compatibility with temporary tables
Since v5.3.0, TiCDC supports global temporary tables. Replicating global temporary tables to the downstream using TiCDC of a version earlier than v5.3.0 causes table definition error.
If the upstream cluster contains a global temporary table, the downstream TiDB cluster is expected to be v5.3.0 or a later version. Otherwise, an error occurs during the replication process.