Tobia
Tobia

Reputation: 9506

Cannot delete or update a parent row: a foreign key constraint fails with Galera and MaxScale

I'm working with two servers MariaDB with galera replication and MaxScale rw router.
One server takes write queryies only, the other one just selects.

I have this sequence of operations:

This is not a systematics issue; most times it works without error, but a few times it fails. It may be connected to replication; that answers why most times it works and why the issue is thrown after the commit.

What I'm missing?

The issue doesn't arise from the master-write database because it is the database of the first tableA insertion. It is more likely the issue comes from the second server at replication time.

But since the transaction is unique and the replication works by entire transactions, how is it possibile that the foreign key doesn't work?

Upvotes: 0

Views: 26

Answers (0)

Related Questions