atomicity in galera multi-master

66 Views Asked by At

Maybe this question is so obvious it doesn't bear asking, but I haven't been able to answer it from the internet.

In the case of Galera multi-master replication, is this statement still guaranteed to be atomic?

UPDATE table 
SET col = new_value 
WHERE
  primary_key = ? and col = old_value;

in that if two clients issued the same request for a given primary_key and old_value, only one would successfully update a row, is that correct?

1

There are 1 best solutions below

0
danblack On

Yes. Atomicity is correct even if both clients are updating on different cluster members.

Upon commit, (even if explicit), like locally, one of the client's will get a DEADLOCK error.

Reference: certification based replication