ross-hello-world · regional failover reference — AlloyDB
This service's database is a dual-region AlloyDB deployment: a writable
PRIMARY cluster in one region and a continuously-replicating SECONDARY in another.
Everything below is live — the cards come from the AlloyDB Admin API, and the
connectivity check is a real SELECT against the primary over its private
(PSC) endpoint using IAM authentication.
Live topology
PRIMARY …
replication cross-region
SECONDARY …
Live connectivity — direct PSC + IAM auth, no passwords stored
- status
- checking…
- target
- …
- round-trip
- …
- server time
- …
pg_is_in_recovery()- …
- server version
- …
pg_is_in_recovery() = false proves we are talking to the writable primary.
After a DR promotion this same check, pointed at the promoted secondary, flips the story.
What fails over by itself — and what doesn't
| Failure | What happens | Who acts |
|---|---|---|
| Zone lost in the primary region | AlloyDB fails over to the in-region HA standby automatically. RPO ≈ 0. | automatic |
| Primary region lost | Nothing fails over on its own. A human promotes the SECONDARY, which becomes a standalone writable PRIMARY. RPO ≈ replication lag at the moment of failure; RTO ≈ time to decide + promote + re-point apps. | manual |
| After promotion | Promotion is one-way: the old primary doesn't rejoin — a new secondary must be created (in the surviving or recovered region) to restore DR coverage. Apps must re-point to the promoted cluster's endpoint. | manual follow-up |
The drill, condensed
gcloud alloydb clusters promote ross-hello-world-secondary \
--region=us-central1 --project=client-dev-e301d
Contrast with this service's other datastores: Firestore (nam5) and the
dual-region GCS bucket fail over automatically with nothing to promote.
Same company, three datastores, two different failover contracts. (Cloud SQL — still
running elsewhere at Abridge, but not for new databases since AlloyDB became the
standard — sits between them: its cross-region replica is readable while it
replicates; an AlloyDB secondary is not.)