2

We are in the process of evaluating MariaDB Galera cluster for our application. As I understand the cluster supports row level and statement level replication. We are leaning towards the row level replication. Our data model has multiple entities related to each other. We are going to have foreign key relationships among the entities.

Would like to understand if we go with row based replication how the cluster would handle the following scenario.

1> The cluster has 3 nodes

2> There are entities like Class and Student. In this we have a foreign key Student -> Class

3> We get two nodes (N1 & N2) get two separate updates from two different transactions

A) At time t1 : Node N1 gets inserts for a students(s1 and s2) for a particular classes c1 and c2 respectively.

B) At time t2 : The class c1 gets deleted from node N2

C) At time t3 : The change (addition of the student s1 and s2) gets pushed from N1 to N2

Would the entire transaction involving the students addition would be rolled back?

TechEnthusiast
  • 1,795
  • 2
  • 17
  • 32

1 Answers1

2

RBR only.

At the time of COMMIT, you must check for errors. This is the time at which conflicts are checked with other nodes.

That is, one node may have no conflicts, only to find out (at COMMIT) that what looked good on that node will collide with whatever was simultaneously happening on other node(s).

More Galera tips

In general, whenever you get "deadlock", simply rerun the entire transaction. It will probably work the second time (or encounter some other error, now that the remote transaction has made it the current node).

Rick James
  • 135,179
  • 13
  • 127
  • 222