Add opt-in demotion database safety gate

This commit is contained in:
Lyncoln
2026-09-17 18:53:41 -04:00
parent 6f1f8814f2
commit 8efa03bf1d
4 changed files with 29 additions and 3 deletions
+1
View File
@@ -27,6 +27,7 @@ python3 ./tests/test-proxy-client-parameters.py
./tests/test-notify-daemon-shadow.sh
./tests/test-notify-target-shadow.sh
./tests/test-demote-database-shadow.sh
./tests/test-demote-database-gate.sh
echo
echo ">>> Python syntax"
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"
FILE="$ROOT/ocf/loxthelion/managed-container.d/applications/postgresql/native_peers.sh"
grep -q 'MC_DEMOTE_DATABASE_GATE' "$FILE"
grep -q 'gate rejected demotion' "$FILE"
grep -q 'if ! mc_pg_demote_database_shadow' "$FILE"
echo "DEMOTE_DATABASE_GATE_TEST_PASS=1"