Browse Source

M7(1d/3): add m7_smoke_runner.sh that stops archiverd before smoke

The archiverd compose service runs in an hourly loop with first run
immediate. The canonical m7_smoke.sh runs a one-shot archiverd in
the ingestd container; both compete for pg_try_advisory_lock(0xBA21B0DA)
and only the first holder wins. The smoke needs the deterministic one.

This wrapper stops the archiverd service first to release the lock,
then runs the canonical 4-step smoke.
Luis Rosales 1 month ago
parent
commit
02545cddcc
1 changed files with 29 additions and 0 deletions
  1. 29 0
      scripts/m7_smoke_runner.sh

+ 29 - 0
scripts/m7_smoke_runner.sh

@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+# M7 smoke runner: stops the archiverd service first to release the
+# advisory lock, then runs the canonical 4-step M7 smoke.
+#
+# This wrapper exists because:
+#   - The archiverd compose service runs in an hourly loop with first-run
+#     immediate, so it would race the smoke's one-shot exec for the
+#     pg_try_advisory_lock(0xBA21B0DA). Only one wins per cycle, and the
+#     smoke needs the deterministic one.
+#   - The canonical smoke (scripts/m7_smoke.sh) hardcodes the project
+#     prefix `broad-announce-` and uses `docker exec` + `curl localhost`
+#     which all resolve correctly on a remote host that has the stack up
+#     under that compose project name.
+#
+# Usage:
+#   cd /root/broad-announce
+#   bash scripts/m7_smoke_runner.sh
+#
+# Exits with the smoke's exit code.
+
+set -e
+cd "$(dirname "$0")/.."
+
+echo "=== pre-smoke: stop archiverd (release the advisory lock) ==="
+docker compose stop archiverd 2>&1 | tail -3
+echo
+
+echo "=== run the M7 smoke ==="
+bash scripts/m7_smoke.sh