This topic provides answers to commonly asked questions about data synchronization to AnalyticDB for MySQL by using Data Transmission Service (DTS).

Errors reported when you modify a data type

Sample error
'id' is LONG type, Can't change column type to DECIMAL
Or
modify precision is not supported, col=id, type decimal, old=11, new=21
Cause
  • Modification across large field types is not supported, such as int->varchar.
  • Decimal precision modification is not supported, such as decimal(4,2)->decimal(6,2).
Solution
  • Non-full-database synchronization:

    We recommend that you resynchronize the table, which is to first remove the table from the synchronization object, delete the table from the destination database, and then add the table to the synchronization object. DTS reperforms full synchronization including schema pulling. This way, DDL statements of the non-full-database synchronization are deleted.

  • Full-database synchronization:

    You can create a new table by using a different name in AnalyticDB for MySQL. The table schema is the same as that of the source table. You must execute the INSERT INTO SELECT statement to write data of the source table for which an error is reported to the new table, delete the source table, execute the RENAME statement to change the name of the new table to that of the source table, and then restart the data synchronization task.

Write invalid date value

Sample error
Cannot parse "2013-05-00 00:00:00": Value 0 for dayOfMonth must be in the range [1,31]]
Errors are reported for fields of the time and date types.
Cause
Different from MySQL, AnalyticDB for MySQL does not allow you to write invalid date values.
Solution
  • The task is in the initialization and full synchronization stage:

    You must change the values of the source table to valid values. For example, change 2013-05-00 00:00:00 to 2013-05-01 00:00:00.

  • The task is in the incremental synchronization stage:

    You must remove the source table from the synchronization objects, change values in the source table to valid values, add the table to the synchronization objects, and then restart the task.

  • Errors are reported when you perform full database synchronization during the incremental synchronization stage:

    You can submit a ticket to AnalyticDB for MySQL technical engineers for troubleshooting. The AnalyticDB for MySQL personnel on duty turn on the invalid value writing switch. After the switch is turned on, all invalid values written are converted to null.

Synchronize tables without primary keys

Sample error
The table does not exist. Example:
DTS-077004: Record Replicator error. cause by [[17003,2020051513063717201600100703453067067] table not exist => xxx_table] 
Cause
ADB does not allow you to synchronize tables if primary keys are not specified.
Solution
This scenario occurs only when the full database is synchronized. You must first determine whether the source database is a table without a primary key. If the source database is a table without a primary key, you cannot synchronize tables without primary keys to AnalyticDB for MySQL by using DTS. To solve this problem, you must create a table in the destination database and make sure that the new table has primary keys. After you create the table, restart the data synchronization task.

An error is returned if the default field value is too long when table is created

Sample error
default value is too long
Solution
Submit a ticket to upgrade the AnalyticDB for MySQL clusters to the latest version.

More than 16 MB of data is written in a single record

Sample error
com.mysql.jdbc.PacketTooBigException: Packet for query is too large (120468711 > 33554432). You can change this value on the server by setting the max_allowed_packet' variable.
Solution
Submit a ticket to upgrade the AnalyticDB for MySQL clusters to the latest version.

The disk space is full

Sample error
disk is over flow
Solution
Delete part of data to release enough disk space, or submit a ticket to request a scale-out. Make sure the disk space is enough, and then restart the DTS task.

Lack tables or fields

Sample error
table not exist => t1
Solution
First, check whether to synchronize all DDL statements, such as statements when the table is created and other DDL statements, are selected when DTS statements are configured. If all DDL statements are not synchronized, select all DDL statements.