A Galera cluster is supposed to behave like one database. After a network partition, it can briefly look like two. That is a split-brain: two groups of nodes, each with a copy of the data, no longer agreeing on a single primary component. If you write to the wrong side, or bootstrap the stale side, you invent a second history that is painful to merge.
This post is a practical checklist for MariaDB and MySQL Galera operators. It does not replace your runbook, but it should help you read the status output, avoid the usual recovery mistakes, and design the cluster so a partition is boring instead of existential.
Quorum, in one paragraph
Galera uses a quorum of the last known membership. The group that still has a majority of the previous members becomes the Primary Component and keeps taking writes. The minority becomes non-Primary: wsrep_cluster_status is no longer Primary, wsrep_ready often goes off, and those nodes refuse application writes. That is the feature, not the bug. It is how the cluster avoids two writers.
Majority is counted in voting weights, not in "which rack looks healthier." A single node that was last seen in a three-node cluster cannot, by itself, remain Primary. Two nodes out of three can. Two nodes out of two cannot decide after they lose each other, because neither side has a majority. That is why a two-node cluster is a split-brain trap, and why an odd node count — or a Galera arbitrator (garbd) as a lightweight third voter — is the default advice.
What you should look at first
On every reachable node, collect:
SHOW GLOBAL STATUS LIKE 'wsrep%';
SHOW GLOBAL VARIABLES LIKE 'wsrep%';The values that usually settle the argument:
wsrep_cluster_status.Primarymeans this node thinks it is in the writable component.non-PrimaryorDisconnectedmeans it should not take writes.wsrep_cluster_sizeandwsrep_cluster_conf_id. Size should match the members you expect. A sudden drop, or differentconf_idvalues across nodes, means the membership just changed or the sides have diverged.wsrep_cluster_state_uuidandwsrep_last_committed. Nodes in the same component share a state UUID. Different UUIDs, or a large gap inwsrep_last_committed, are how you tell "this side continued" from "this side is behind."wsrep_local_state_comment. Healthy members that are applying writes showSynced.Donor/Desynced,Joiner, orJoinedare transient.Initializedor an empty comment on a node you thought was live is a warning.wsrep_readyandwsrep_connected. If a node is connected but not ready, the process is up and still not safe for application traffic.
If you can, paste the same output from every node into one place and compare UUID, conf_id, size, and last committed sequence. The side you want to keep is almost always the Primary Component with the highest committed sequence in the last common UUID — not the side with the most disks, the newest hardware, or the node you can SSH into first.
How a split-brain actually presents
In a well-configured cluster, a clean partition is not two Primaries. It is one Primary and one non-Primary minority. Applications that still point at the minority start seeing errors; a load balancer that does not check wsrep_ready may keep sending them traffic anyway.
The dangerous cases are more specific:
- A two-node cluster, or any even-sized cluster with no arbitrator, after a network cut. Neither side has quorum. Operators then feel pressure to "just bootstrap one."
pc.ignore_sb(or equivalent) enabled. The cluster is being told to ignore split-brain and keep serving. That setting exists; it is rarely what you want in production.- A previously non-Primary node started with
--wsrep-new-clusteror a forced bootstrap. That node founds a new component. If the old Primary is still alive, you now have two histories. - Nodes that were down during the partition coming back with an old
grastate.datand being asked to form a new cluster.
If two sides both show Primary and they do not share a wsrep_cluster_state_uuid, stop writes on both, immediately. Do not try to "catch up" across that gap with normal replication. You are past the point where Galera can reconcile automatically.
Recovery without making it worse
- Fence writers. Point the VIP, ProxySQL, HAProxy or MaxScale at nothing, or at a side you have already confirmed is the Primary you intend to keep. Take a filesystem snapshot or a physical backup if you still can.
- Pick a survivor using the status values above, plus
grastate.daton nodes that are down (safe_to_bootstrapandseqno). Do not bootstrap a node just because it started first. - Keep the chosen Primary isolated until the other side is shut down cleanly. Then start the remaining nodes as joiners, not as a new cluster, so they request IST or SST from the survivor.
- After SST finishes, check that every node shares the same UUID, the same
conf_id,wsrep_cluster_status=Primary, andwsrep_local_state_comment=Synced. - Only then reopen writes. If you wrote to the discarded side during the incident, those transactions are not in the surviving history. Restore them from application logs or a backup; do not pretend a later SST kept them.
The two commands that cause the most pain are a premature --wsrep-new-cluster and an unattended pc.ignore_sb=true. Treat both as break-glass, and record that you used them.
Make the next partition boring
- Run an odd number of voting members, or add
garbdif you only have two data nodes. - Health-check
wsrep_ready,wsrep_connected, andwsrep_local_state_comment=Syncedon the load balancer, not just "mysqld is listening." - Alert on
wsrep_cluster_status != Primary, a drop inwsrep_cluster_size, flow-control pauses, and nodes that leave Synced and do not come back. - Rehearse a node loss on a staging cluster, including the bootstrap decision, before you need it at 03:00.
Jarwis ClusterOps watches these Galera signals continuously and can alert when a node leaves the Primary Component or when members disagree on cluster identity. Lite is free up to three nodes, which is exactly the topology this article is about; Galera cluster management shows what else it covers. If you want to walk through a live cluster without touching your own, there is a read-only demo at demo.jarwis.com. The longer operational reference is in the docs.