We have 4 servers located in two data centers. A direct line connects the two datacenters. We are planning to switch from MariaDB to MariaBD Gallera as circular replication is a pain.
A load-balancer is used to determine which server will handle an incoming request which can be any of the four servers.
My concern is what happens when the connection between the data center is down? Will each two centers form a mini cluster until the connection is back and then they reorganize themselves into a 4 node cluster again?
How does Galera prevent primary key duplication issues that may occure when the connection between the two data centers fails?
Imagine that the load-balancer starts forwarding requests to both data centers and inserts take place in both of them which may result in PK duplication issues when the connection come back.
I have tried to simulate the different cases using vmware station however I have no idea how to replicate this case. I have managed to create a 4 node replication cluster and managed to take out and bring nodes into the cluster. However I have no idea how simulate data centers.