Type | Description |
Source database limits | The tables to synchronize must have a primary key or a unique constraint, and the fields must be unique. Otherwise, duplicate data may appear in the destination database. If you synchronize at the table level and need to edit mappings (such as column name mapping), each synchronization task supports up to 1,000 tables. If you exceed this limit, the task fails with an error. To fix this, split the tables across multiple tasks or configure a full-database synchronization task. Binary logs: ApsaraDB RDS for MySQL enables binary logging by default. Ensure that the binlog_row_image parameter is set to full. Otherwise, the precheck fails and the synchronization task cannot start. For instructions, see Configure instance parameters.
Important If your source instance is a self-managed MySQL database, enable binary logging and set binlog_format to row and binlog_row_image to full. If your self-managed MySQL database is a dual-primary cluster (where both nodes act as primary and secondary), enable the log_slave_updates parameter so DTS can capture all binary log events. For instructions, see Create an account and configure binary logging for a self-managed MySQL database.
The local binary logs for an ApsaraDB RDS for MySQL instance must be retained for at least three days (seven days is recommended). For a self-managed MySQL database, retain local binary logs for at least seven days. Otherwise, DTS may fail to retrieve binary logs, causing the task to fail. In extreme cases, this may cause data inconsistency or data loss. Issues caused by binary log retention periods shorter than DTS requires are not covered under the DTS SLA.
Do not run DDL operations that change database or table schemas during schema synchronization or full synchronization. Otherwise, the synchronization task fails.
Note During full synchronization, DTS queries the source database. This creates metadata locks that may block DDL operations on the source database. Data generated by changes that do not write to binary logs—such as data restored from physical backups or created by cascade operations—is not synchronized to the destination database.
Note If this occurs, remove the affected database or table from the synchronization objects. Then add it back. You can do this only if your business allows it. For more information, see Modify synchronization objects. If your source database is MySQL 8.0.23 or later and contains invisible hidden columns, DTS may not read those columns. This may cause data loss.
Note Run the ALTER TABLE <table_name> ALTER COLUMN <column_name> SET VISIBLE; command to make the hidden column visible. For more information, see Invisible Columns. MySQL compatibility: When DTS synchronizes data from a MySQL-family source database, it relies on the standard MySQL protocol and Binlog format, and behaviors incompatible with standard MySQL are not supported. If your source database claims MySQL compatibility but behaves differently from MySQL (for example, when OceanBase is connected as a source in MySQL mode, the timestamp of the trailing rotate event in the Binlog is 0, which differs from MySQL), the DTS synchronization task may fail.
|
Other limits | Synchronization object requirements: Only table-level synchronization is supported. DTS does not support synchronizing BIT, VARBIT, GEOMETRY, LINESTRING, POLYGON, ARRAY, UUID, TSQUERY, TSVECTOR, TXID_SNAPSHOT, or POINT data types. DTS does not support synchronizing prefix indexes. If your source database contains prefix indexes, synchronization may fail. DTS does not support synchronizing partitions, views, stored procedures, functions, or triggers.
If your source database uses online DDL operations in temporary table mode—including but not limited to multi-table merge scenarios—or adds function-based indexes to unique key columns, data loss or task failure may occur in the destination database. If a primary key or unique key conflict occurs while the task is running: If the table schemas are consistent and a record in the destination database has the same primary key or unique key value as a record in the source database: During full data synchronization, DTS retains the destination record and skips the source record. During incremental synchronization, DTS overwrites the destination record with the source record.
If the table schemas are inconsistent, data initialization may fail. This can result in only partial data synchronization or a complete synchronization failure. Use with caution.
Assess the performance of both the source and destination databases before starting synchronization. Run synchronization during off-peak hours. Otherwise, full initialization consumes read and write resources on both databases and may increase database load. Full initialization runs INSERT operations concurrently. This fragments destination tables. After full initialization, the tablespace of the destination instance is larger than that of the source instance. If you synchronize one or more tables—not a full database—do not use tools like pt-online-schema-change to perform online DDL operations on the source tables. Otherwise, synchronization fails. You can use Data Management (DMS) to perform online DDL operations. For more information, see Online DDL without locking tables. Do not write data to the destination database except through DTS while synchronization is running. Otherwise, data inconsistency may occur between the source and destination databases. For example, if you use DMS to perform online DDL operations while other data is written to the destination database, data loss may occur. If your ApsaraDB RDS for MySQL instance has Always-Encrypted enabled, full data synchronization is not supported.
Note ApsaraDB RDS for MySQL instances with Transparent Data Encryption (TDE) enabled support schema synchronization, full data synchronization, and incremental data synchronization. -
For full or incremental data synchronization tasks, if the source tables to be synchronized contain foreign keys, triggers, or event triggers, DTS temporarily sets the session_replication_role parameter to replica at the session level. If the destination database account does not have the required permissions, you must manually set the session_replication_role parameter to replica in the destination database. During this period, if cascade update or delete operations occur in the source database while session_replication_role is set to replica, data inconsistency may occur. After the DTS task is released, change the session_replication_role parameter back to origin.
If a task fails, DTS support staff will attempt to restore it within eight hours. During restoration, they may restart the task or adjust its parameters.
Note Only DTS task parameters are modified—not database parameters. Parameters that may be adjusted include those listed in Modify instance parameters.
|
Special cases | For a self-managed MySQL source database: If a primary/secondary switchover occurs in the source database during synchronization, the task fails. DTS calculates latency by comparing the timestamp of the last synchronized record with the current time. If no DML operations run for a long time in the source database, latency reporting may become inaccurate. If latency appears too high, run a DML operation in the source database to update the latency.
Note If you select a full database for synchronization, create a heartbeat table. Update or write to this table every second. DTS periodically runs the CREATE DATABASE IF NOT EXISTS `test` command in the source database to advance the binary log offset. If your source database is Amazon Aurora MySQL or another clustered MySQL instance, ensure the domain name or IP address used in the task configuration—and its DNS resolution—always points to a read/write (RW) node. Otherwise, synchronization may fail.
For an ApsaraDB RDS for MySQL source database: Read-only instances—such as ApsaraDB RDS for MySQL 5.6 read-only instances—that do not record transaction logs cannot serve as source databases. DTS periodically runs the CREATE DATABASE IF NOT EXISTS `test` command in the source database to advance the binary log offset.
|