All Products
Search
Document Center

Data Transmission Service:Configure a conflict resolution policy

Last Updated:Mar 28, 2026

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 typeTrigger conditionDTS behavior
INSERT uniqueness conflictAn INSERT operation violates a unique constraint on the destination instanceDTS automatically ignores the INSERT operation
UPDATE record mismatchThe record to update does not exist or conflicts with an existing record on the destination instanceDTS automatically ignores the UPDATE operation
DELETE record missingThe record to delete does not exist on the destination instanceDTS automatically ignores the DELETE operation

Other supported databases:

Conflict typeTrigger conditionDTS behavior
INSERT uniqueness conflictA record with the same primary key is inserted on both nodes at nearly the same timeOne of the inserted records fails to synchronize due to the duplicate primary key
UPDATE record mismatchThe record to update does not exist or conflicts with an existing record on the destination instanceDTS converts the UPDATE to an INSERT; uniqueness conflicts may then occur
DELETE record missingThe record to delete does not exist on the destination instanceDTS 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 typeSupported instances
Global conflict resolution policyAll two-way synchronization instances except Tair (Enterprise Edition) instances. For supported instances, see Two-way synchronization.
Independent conflict resolution policyTwo-way sync between MySQL databases; two-way sync between PolarDB for MySQL databases

Choose a conflict resolution policy

Global policies

PolicyBehaviorWhen to use
OverwriteOverwrites the conflicting record on the destination instance with the incoming recordIncoming data should always win; destination state is expendable
IgnoreSkips the conflicting statement; the task continues using the existing record on the destination instanceDestination data takes priority; incoming changes should be dropped on conflict
TaskFailedStops the synchronization task and enters a failed state, requiring manual interventionConflicts 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:

PolicyBehaviorWhen to use
OverwriteOverwrites the conflicting column value on the destination instanceIncoming value should always win
IgnoreKeeps the existing value on the destination instanceDestination value takes priority
TaskFailedStops the synchronization task; requires manual interventionEvery conflict requires review
UseMaxWrites 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
UseMinWrites 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.
image

Configure an independent conflict resolution policy

Independent conflict resolution policies are set at the database or table level.

At the database level

  1. In Selected Objects, right-click the database you want to sync.

  2. In the dialog box, under Independent Conflict Resolution Policy, set Enable Independent Conflict Resolution Policy to Yes.

  3. Select a Conflict Resolution Policy.

  4. Click Columns for Conflict Detection on the right side of Add Column.

  5. 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.
  6. Click OK.

At the table level

  1. In Selected Objects, right-click the table you want to sync.

  2. In the dialog box, under Column, select Independent Conflict Resolution Policy.

  3. 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.
  4. Select a Conflict Resolution Policy.

    If Columns for Conflict Detection is auto-selected by the system, UseMax and UseMin are not available.
  5. 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.