I have addressed previously how multi-node writing causes unexpected deadlocks in PXC, at least, it is unexpected unless you know how Galera replication works. This is a complicated topic and I personally feel like I’m only just starting to wrap my head around it.
The magic of Galera replication
The short of it is that Galera replication is not a doing a full 2-phase commit to replicate (where all nodes commit synchronously with the client), but it is instead something Codership calls “virtually synchronous” replication. This could either be clever marketing or clever engineering, at least at face value. However, I believe it really is clever engineering and that it is probably the best compromise for performance and data protection out there.
…
[Read more]