Help Center/ Data Replication Service/ FAQs/ General Operations/ Data Inconsistency May Occur After a DDL Statement Is Executed to Modify a Primary Key or Unique Index in the Destination Database
Updated on 2025-07-24 GMT+08:00

Data Inconsistency May Occur After a DDL Statement Is Executed to Modify a Primary Key or Unique Index in the Destination Database

DRS caches the table structure of the destination database to reduce the impact on querying the destination database and improve data transmission efficiency. After a DDL statement is executed on a table to be synchronized in the source database, DRS queries the table structure of the destination database again and updates the cache. If a primary key or unique index of the destination database table is modified during a DRS task, the conflict analysis of the DRS task may become invalid, affecting data consistency.

  • It is recommended that primary keys and unique indexes of the destination database be the same as those of the source database. Otherwise, data may be overwritten due to data conflicts.
  • Before executing DDL statements to modify primary keys or unique indexes in the destination database, you are advised to pause the DRS task and resume the task after the DDL statements are executed.