diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-07-01 11:53:30 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-07-01 11:53:30 -0400 |
commit | 65bbd6c63583281211bca10fcdbba68bd8f681bb (patch) | |
tree | 16cb82264e42256b8c8236b0d30b4c7b56c59577 /ops/robust-psql.md | |
parent | 9267b77dc67472bec73ce3f1f7ff52c3f909587f (diff) | |
download | sr.ht-docs-65bbd6c63583281211bca10fcdbba68bd8f681bb.tar.gz |
Confirm workitude of standby promotion procedure
Diffstat (limited to 'ops/robust-psql.md')
-rw-r--r-- | ops/robust-psql.md | 29 |
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 |