SymmetricDS - Detected losing row for batch [[batch]] for missing foreign key parent [[table]]: [[id]]

111 Views Asked by At

I'm having an issue with SymmetricDS when it comes to sync.

So the issue is as follows, I have an HQ (1) and one Agency (2). This issue does not happen in the HQ --> Agency route, and only in the Agency --> HQ route.

The error is as follows:

[sede-000] [DefaultDatabaseWriterConflictResolver] [sede-000-dataloader-1665] Detected losing row for batch preagencia002-680 for missing foreign key parent agencias:7090efee-379d-44f7-bb58-4ca4e596c62f

It seems some rows are being lost in the transaction. There's no error in the incoming batch table or anything.

The databases are the same, meaning they started with the same image, FK, Data, everything is the same, I then installed SymmetricDS in the HQ as the registration computer (So it could be the hq). Afterwards I connected the Agency to the HQ's symmetric and it registered sucessfully. All fine so far.

It worked fine for a few months, all data was being synced correctly in both ways. Then the client decided to do some connectivity tests where they unplugged the network cable in the middle of a DB save, that's fine as all data is being saved to a local DB and everything is afterwards replicated to the HQ when connection is restored.

But after these network tests I started getting the above errors where the Agency successfully pushes the data to the HQ and then the HQ can't seem to update/add rows due to a foreign key? I have confirmed that all data related to this foreign key is there: "7090efee-379d-44f7-bb58-4ca4e596c62f" exists in the "agencies" column and it's all there, all FK constraints are all there too.

I'm at a loss here. Keeping in mind that it stopped working in the PreProd environment, still works perfectly in the dev env. Could it be that these network tests broke something in SymmetricDS?

Any pointers would be appreciated.

Edit: To reiterate on what's being said.

The agency foreign key exists in the HQ database, so there's no reason why it should happen. Is there any way I can force any kind of resolution? Because this has been happening for a while and I'm still nowhere near resolving this issue.

0

There are 0 best solutions below