Conflict resolution policies control how DTS handles data conflicts in two-way synchronization instances, keeping sync tasks stable and data consistent.
How it works
In two-way synchronization, both nodes can receive writes simultaneously. When the same record is modified on both nodes at nearly the same time, a conflict occurs. DTS detects these conflicts and resolves them according to the policy you configure.
Conflict detection — DTS identifies conflicts by type. Behavior differs depending on whether the instance is ApsaraDB for MongoDB or another supported database:
ApsaraDB for MongoDB two-way synchronization:
| Conflict type | Trigger condition | DTS behavior |
|---|---|---|
| INSERT uniqueness conflict | An INSERT operation violates a unique constraint on the destination instance | DTS automatically ignores the INSERT operation |
| UPDATE record mismatch | The record to update does not exist or conflicts with an existing record on the destination instance | DTS automatically ignores the UPDATE operation |
| DELETE record missing | The record to delete does not exist on the destination instance | DTS automatically ignores the DELETE operation |
Other supported databases:
| Conflict type | Trigger condition | DTS behavior |
|---|---|---|
| INSERT uniqueness conflict | A record with the same primary key is inserted on both nodes at nearly the same time | One of the inserted records fails to synchronize due to the duplicate primary key |
| UPDATE record mismatch | The record to update does not exist or conflicts with an existing record on the destination instance | DTS converts the UPDATE to an INSERT; uniqueness conflicts may then occur |
| DELETE record missing | The record to delete does not exist on the destination instance | DTS ignores the DELETE operation regardless of the conflict resolution policy you configure |
Conflict resolution — DTS responds to each detected conflict based on the policy you configure. Two policy levels are available:
Global conflict resolution policy — applies to all objects in the synchronization task
Independent conflict resolution policy — applies to specific columns, overriding the global policy for those columns
DTS cannot guarantee that conflict detection prevents every conflict. System time differences between synchronization nodes and synchronization latency can allow conflicting writes to go undetected. To avoid conflicts, ensure that records with the same primary key, business primary key, or unique key are updated on only one synchronization node at a time. If data records are updated on both nodes, DTS responds to conflicts based on the conflict resolution policy you configure for the task.
Supported instances
| Policy type | Supported instances |
|---|---|
| Global conflict resolution policy | All two-way synchronization instances except Tair (Enterprise Edition) instances. For supported instances, see Two-way synchronization. |
| Independent conflict resolution policy | Two-way sync between MySQL databases; two-way sync between PolarDB for MySQL databases |
Choose a conflict resolution policy
Global policies
| Policy | Behavior | When to use |
|---|---|---|
| Overwrite | Overwrites the conflicting record on the destination instance with the incoming record | Incoming data should always win; destination state is expendable |
| Ignore | Skips the conflicting statement; the task continues using the existing record on the destination instance | Destination data takes priority; incoming changes should be dropped on conflict |
| TaskFailed | Stops the synchronization task and enters a failed state, requiring manual intervention | Conflicts must never go unnoticed; every conflict requires human review |
Independent policies (column-level)
Independent policies apply to specific columns in MySQL and PolarDB for MySQL two-way synchronization instances. They support the same three options as global policies, plus two numeric comparison options:
| Policy | Behavior | When to use |
|---|---|---|
| Overwrite | Overwrites the conflicting column value on the destination instance | Incoming value should always win |
| Ignore | Keeps the existing value on the destination instance | Destination value takes priority |
| TaskFailed | Stops the synchronization task; requires manual intervention | Every conflict requires review |
| UseMax | Writes the higher of the two conflicting values to the destination instance. If the target record is absent or the column type is incompatible, falls back to Overwrite. | Counters, scores, or any numeric column where the larger value should win — for example, tracking a running maximum |
| UseMin | Writes the lower of the two conflicting values to the destination instance. If the target record is absent or the column type is incompatible, falls back to Ignore. | Numeric columns where the smaller value should win — for example, earliest-timestamp tracking |
Prerequisites
Before you begin, ensure that you have:
A two-way synchronization instance with Synchronization Topology set to Two-way Synchronization
Access to the Configure Objects phase for either the forward or reverse task in the two-way synchronization instance
Usage notes
For two-way synchronization between ApsaraDB for MongoDB instances, only the Ignore policy is supported. DTS automatically ignores conflicting INSERT, UPDATE, and DELETE operations.
Independent conflict resolution policies apply only to incremental synchronization.
Columns with an independent conflict resolution policy are not affected by the global policy.
If you do not configure an independent conflict resolution policy during the initial setup, you cannot add one later when modifying synchronization objects.
If a synchronization task is paused or restarted and there is a delay, the configured policy does not take effect during the delay period — DTS defaults to overwriting data on the destination instance.
Configure a global conflict resolution policy
In the Configure Objects phase, select a Global Conflict Resolution Policy.
For two-way synchronization between ApsaraDB for MongoDB instances, only Ignore is available.

Configure an independent conflict resolution policy
Independent conflict resolution policies are set at the database or table level.
At the database level
In Selected Objects, right-click the database you want to sync.
In the dialog box, under Independent Conflict Resolution Policy, set Enable Independent Conflict Resolution Policy to Yes.
Select a Conflict Resolution Policy.
Click Columns for Conflict Detection on the right side of Add Column.
In the Column Name field, enter the column name.
If the column uses the mapping feature, enter the mapped column name. To add more columns, click Columns for Conflict Detection again.
Click OK.
At the table level
In Selected Objects, right-click the table you want to sync.
In the dialog box, under Column, select Independent Conflict Resolution Policy.
In Columns for Conflict Detection, select the columns to assign an independent policy to.
Columns with primary keys and unique constraints are selected by default.
Select a Conflict Resolution Policy.
If Columns for Conflict Detection is auto-selected by the system, UseMax and UseMin are not available.
Click OK.
FAQ
Can I modify a conflict resolution policy after the task is running?
To change the global conflict resolution policy, modify the objects to be synchronized. Independent conflict resolution policies cannot be added after initial configuration.