Help Center> Data Replication Service> Troubleshooting> Failure Cases> Real-Time Migration and Synchronization from MySQL to MySQL> Full Phase Error: Lock wait timeout exceeded; try restarting transaction
Updated on 2022-09-21 GMT+08:00

Full Phase Error: Lock wait timeout exceeded; try restarting transaction

Scenarios

During a full migration or synchronization, an error is reported, and the log information is as follows: service DATAMOVE failed, cause by: apply event=[type=table_data, batch_index_in_shard=***, table_schema= %s, table_name= %s, record_num=***] occur error, msg=apply data of table=` %s `.` %s ` failed: Lock wait timeout exceeded; try restarting transaction.

Possible Causes

A lock wait times out when data is written to the destination database. The possible causes are as follows:

  • The service connection of the destination database holds the lock for a long time.
  • The performance of the destination database is insufficient or the load is heavy, and the execution is slow.

Solution

Contact the customer's O&M personnel to check the lock usage, slow SQL statements, or load status of the destination database.