aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ops/robust-psql.md29
1 files changed, 25 insertions, 4 deletions
diff --git a/ops/robust-psql.md b/ops/robust-psql.md
index 256a8af..20d0cbd 100644
--- a/ops/robust-psql.md
+++ b/ops/robust-psql.md
@@ -131,15 +131,36 @@ is sufficient for the MVP.
# Failover procedure (read-only mode)
-*Ideally, this is to be announced in advance, as it will cause a partial outage
-across all services.*
+*If possible, this is to be announced in advance. It will cause a partial outage
+of all services.*
First, prepare all services for failover by updating their pgbouncer
configurations to point to the standby. Do not reload any of the pgbouncer
instances until all service configs have been updated, then use a script to
update them all at once.
-TODO: Write that script
+```sh
+#!/bin/sh
+hosts=meta.sr.ht \
+ git.sr.ht \
+ hg.sr.ht \
+ builds.sr.ht \
+ lists.sr.ht \
+ todo.sr.ht \
+ man.sr.ht \
+ dispatch.sr.ht \
+ paste.sr.ht \
+ hub.sr.ht \
+ cirno1.sr.ht \
+ cirno2.sr.ht \
+ legacy.sr.ht \
+ mail-b.sr.ht
+
+for host in $hosts
+do
+ ssh $host doas service pgbouncer reload
+done
+```
✓ Process tested
@@ -149,7 +170,7 @@ TODO: Write that script
1. Shut off the master
1. Run `pg_ctl promote` on the standby
-✗ TODO: Test this process
+✓ Process tested
# Master demotion procedure