From ce2bdec6f093cf40251dfc669cb235d2c8ac38e4 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 12 Aug 2026 16:55:17 +0200 Subject: [PATCH] fix(swarm-drill): stop the backup timers before the drill goes destructive The DR drill starts the backup units itself, but the deploy arms their calendar timers first, and a job that runs long enough crosses every backup window in group_vars/all/07_schedule.yml. web-app-decidim ran 23:05-02:24 and hit exactly that: the drill's own volume backup succeeded at 01:00:49, then the timer fired a second, unattended run at 01:03:18 while step [8b/9] was lazily unmounting /var/lib/infinito underneath it. The failure is silent by construction. baudolo writes the dump in two processes - 'pg_dump > x.tmp', then 'mv x.tmp x'. The redirect shell exits 0 because a shell never reports a failed writeback on a soft NFS mount, but the unmount discarded that mount instance together with the unflushed file, so the mv resolved through the fresh instance and got ENOENT. The unit died at 01:04:04, the same second the drill finished remounting, and 80 minutes later the CLI test read 'failed' and aborted the job before running its own backup. Disarming the timers makes the drill the only thing driving those units. Stopping a timer does not stop its service, and both the drill and roles/svc-bkp-volume-2-local/files/test/test.sh start their units explicitly, so nothing under test loses coverage. Co-Authored-By: Claude Opus 5 (1M context) --- scripts/tests/deploy/swarm/routine/backup/base.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/tests/deploy/swarm/routine/backup/base.sh b/scripts/tests/deploy/swarm/routine/backup/base.sh index 67f2132b3f..e31dc15b12 100755 --- a/scripts/tests/deploy/swarm/routine/backup/base.sh +++ b/scripts/tests/deploy/swarm/routine/backup/base.sh @@ -72,6 +72,12 @@ UNIT_DUMPS="${INFINITO_RESCUE_DIAGNOSTICS_DIR:?INFINITO_RESCUE_DIAGNOSTICS_DIR i DRILL_START_TS="$(docker exec "${MGR}" date +%Y%m%d%H%M%S)" +echo "==> [0/9] disarm the backup calendar timers for the duration of the drill" +for _node in "${MGR}" "${WRK1}" "${WRK2}" "${NFS_SERVER}"; do + docker exec "${_node}" timeout 660 sh -c \ + "systemctl stop 'svc-bkp-*.timer' 2>/dev/null; while systemctl is-active --quiet 'svc-bkp-*.service'; do sleep 5; done" # nocheck: shell-or-true -- a node without the timers installed has nothing to stop +done + echo "==> [1/9] seed markers (live NFS volume + manager secrets)" docker exec "${NFS_SERVER}" sh -c \ "mkdir -p '${NFS_VOL_DIR}' && printf '%s' '${DR_TOKEN}' > '${NFS_VOL_DIR}/${DR_MARKER}'"