Search code examples
data-synchronizationsymmetricds

SymmetricDS Two Way Synchronization Double Insert


I have server node and client node. They do two way synchronization on a table and also both have sync_on_incoming_batch = 1.

Let say, table structure is (id, name).

The scenario is:

  1. server insert data (1, 'a')
  2. client insert data (1, 'b')
  3. server send batch of (1, 'a') to client
  4. client send batch of (1, 'b') to server
  5. Now, server has data (1, 'b') and client has data (1, 'a')

Questions are:

  1. After server received (1, 'b'), why server cannot route again the data to client? It's detected by node_id = -1 in sym_outgoing_batch on server. Vice versa on client.
  2. How to sync data based on most recent data? So in this case, the result is (1, 'b') in all node.

Solution

    1. sync_on_incoming_batch is telling symmetricDs not to route back data to the source node
    2. add conflict detection with resolution strategy newer wins