From 23634134f008406e540cd6eafb4e0523136d1d46 Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Mon, 27 Jul 2026 06:40:57 +1000 Subject: [PATCH] fix(ha-test): remove Debian LVM handlers and fix corosync authkey length - Remove before/after-resync-target LVM handlers (snapshot-resync-target-lvm.sh doesn't exist in NixOS; exit code 127 caused DRBD to drop connections on sync) - Remove split-brain handler pointing to /usr/lib/drbd/ (Debian path) - Fix testAuthKey from 126 to 128 bytes (corosync minimum is 1024 bits) - Fix cluster-init.sh quorum check: corosync-quorumtool has no -q flag; use -s | grep 'Quorate: Yes' instead Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01HaH1cSGvhogRP5ExoF6nD8 --- test-lab/ha/cluster-init.sh | 2 +- test-lab/ha/common.nix | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/test-lab/ha/cluster-init.sh b/test-lab/ha/cluster-init.sh index 4274740..597017b 100644 --- a/test-lab/ha/cluster-init.sh +++ b/test-lab/ha/cluster-init.sh @@ -39,7 +39,7 @@ die() { echo "[cluster-init] ERROR: $*" >&2; exit 1; } # ── 1. Wait for corosync quorum ────────────────────────────────────────── log "Waiting for corosync quorum..." for i in $(seq 1 30); do - if corosync-quorumtool -q &>/dev/null; then + if corosync-quorumtool -s 2>/dev/null | grep -q 'Quorate:.*Yes'; then log "Quorum established" break fi diff --git a/test-lab/ha/common.nix b/test-lab/ha/common.nix index 9b6a00e..8b75d7b 100644 --- a/test-lab/ha/common.nix +++ b/test-lab/ha/common.nix @@ -8,9 +8,9 @@ let node2Ip = "192.168.2.201"; drbdPort = 7789; - # Test-only corosync authkey (128 bytes minimum). + # Test-only corosync authkey (128 bytes = 1024 bits minimum for corosync). # Not secret — this is a disposable test cluster, not production. - testAuthKey = "ha-test-cluster-auth-key-NOT-FOR-PRODUCTION-use-corosync-keygen-for-real-clusters-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; + testAuthKey = "ha-test-cluster-auth-key-NOT-FOR-PRODUCTION-use-corosync-keygen-for-real-clusters-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; # OCF agent path (from pacemaker's --with-ocfdir). # We expose this on PATH so custom scripts can find each other. @@ -97,11 +97,9 @@ in fencing resource-only; } handlers { - # Called by DRBD when a split-brain is detected and this node is - # in the secondary role — notifies pacemaker to fence the split node. - split-brain "/usr/lib/drbd/notify-split-brain.sh root"; - before-resync-target "/usr/lib/drbd/snapshot-resync-target-lvm.sh -p 15 -- -c 16k"; - after-resync-target "/usr/lib/drbd/unsnapshot-resync-target-lvm.sh"; + # NOTE: LVM-specific before/after-resync-target handlers omitted + # (raw /dev/sdb, no LVM). split-brain handler also omitted — + # Pacemaker STONITH manages split-brain fencing for the test cluster. } }