Rows insertion during an initial load leads to synchronization failure. How to prevent it?

StackOverflow https://stackoverflow.com/questions/22150505

  •  19-10-2022
  •  | 
  •  

문제

I am using SymmetricDS version 3.4.8 to synchronize 2 PostgreSQL DBs.

I have encountered the following problem: I have several dependent tables, e.g. 'node' and 'device' tables where 'device' table has FK to 'node' table; if new rows were added to these tables during the initial sync when 'node' table was already synchronized but 'device' not (so, between 'node' and 'device' tables initial load), processing of 'device' table on slave node fails on trying to insert a new row as it violates foreign key constraints as key isn't present in 'node' table. How can I handle this issue?

Thanks

도움이 되었습니까?

해결책

SymmetricDS uses a separate channel for initial load batches by default. When initial loading in a active environment, these FK violations can occur temporarily by design.

When the initial load channel runs into a FK violation the channel is suspended. Your data channel containing the missing PK will start to sync. Once the data channel is complete, the initial load channel will attempt again to sync. This time there won't be an error because the required PK is now available on the target.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top