Skip to content

DRBD split-brain: recognize StandAlone and resolve it safely

Storagetested on DRBD 9.3.4, LINSTOR 1.34.2

A split-brain happens when both replicas of a DRBD resource were written to separately. DRBD can't decide which changes count and disconnects for good: StandAlone means it doesn't try any more.

Symptom

ssh k0s-w1 'sudo drbdadm status sbtest'
ssh k0s-w1 "sudo journalctl -k --since -3min | grep 'Split-Brain detected' | cut -c1-88"
linstor --no-utf8 --no-color resource list -r sbtest | cut -c44-100
sbtest role:Secondary
  disk:UpToDate open:no
  k0s-w2 connection:StandAlone
Nov 20 02:15:02 k0s-w1 kernel: drbd sbtest/0 drbd1003 k0s-w2: Split-Brain detected but u
| Layers                  | Usage  | Conns              |
| DRBD,WRITECACHE,STORAGE | Unused | StandAlone(k0s-w2) |
| DRBD,WRITECACHE,STORAGE | Unused | StandAlone(k0s-w1) |

Both sides are UpToDate, and each is right on its own. The kernel message ends with "unresolved, dropping connection!".

Diagnosis

Look first, then decide – mount read-only on both nodes. In the course k0s-w2 has "basis" and "seite k0s-w2", k0s-w1 has:

sudo mount -o ro /dev/drbd/by-res/sbtest/0 /mnt/sb
cat /mnt/sb/datei
sudo umount /mnt/sb
basis
seite k0s-w1

Causes

quorum offResource without quorum

Without quorum the tiebreaker is useless and LINSTOR removes it. When the link breaks, each side becomes Primary on mount and keeps writing.

linstor resource-definition drbd-options --quorum off sbtest
Tie breaker marked for deletion

With quorumWith a witness there is no split-brain

With quorum and a witness, only the side that sees the majority may write. An isolated Primary suspends all writes (suspended:quorum) and is demoted later – no split-brain as long as there is a third vote.

qtest node-id:1 role:Primary suspended:quorum force-io-failures:no

Fix

On the losing side, disconnect, become Secondary and connect with --discard-my-data. The winning side doesn't reconnect from StandAlone on its own – run connect there too. DRBD then transfers only the changed blocks.
sudo drbdadm disconnect sbtest
sudo drbdadm secondary sbtest
sudo drbdadm connect --discard-my-data sbtest
sudo drbdadm connect sbtest
sudo drbdadm status sbtest
sbtest role:Secondary
  disk:UpToDate open:no
  k0s-w2 role:Secondary
    peer-disk:UpToDate

Don't: Running --discard-my-data on the wrong node. It irrevocably discards all changes this node made since the split – if in doubt, back up the losing side's data first.

▶
Break it yourself and find it – free
k0s and LINSTOR hands-on, day 11: when DRBD keeps writing, suspends or demotes an old Primary – and resolving a real split-brain.
Go to day 11 →

FAQ

Which node does --discard-my-data belong on?

Always on the node whose data should go. In the course k0s-w1 wins, so the command runs on k0s-w2; afterwards "seite k0s-w2" is gone.

Does StandAlone resolve itself?

No. StandAlone means DRBD no longer tries to connect – the winning side also needs a drbdadm connect.

Related error patterns

More