Miguel Moreno describes a cross-region PostgreSQL recovery exercise in Cloud SQL disaster recovery across regions: one approval, a fence, and what eight failovers taught us. The drills used a 303 GB Cloud SQL instance under synthetic load. The write-up separates the time Cloud SQL spent promoting a replica from the time the surrounding system spent detecting the incident, deciding to act and reconnecting applications.
Time the alert and the clients separately
Promotion took 61 to 84 seconds across eight runs. In the drill that used a real alert, a writable primary was available 1 minute 58 seconds after the alert opened. That clock starts after the monitoring condition has already been met. A script responded to the approval in the drill, so the figure leaves human response time unmeasured.
The team ran its orchestration in the recovery region. Its workflow checked which instance was currently primary and requested one approval for the group of affected pairs. Repeated alerts started more executions, but seven additional executions in the real-alert drill took no recovery action. The example gives operators two milestones worth checking independently: whether the new primary accepts writes and whether the clients have discarded dead or obsolete connections. Moreno reports that the one service using the write endpoint spent 26 seconds to 2.5 minutes dropping dead pool connections.
Count writes on both sides of the promotion
In one trial with a reachable old primary and no fence, Moreno reports that 3,074 of the 3,431 writes accepted there after the promotion command were missing on the new primary. Writers pinned to each instance made the divergence observable. The team's workflow subsequently added a step to stop the old primary after promotion, leaving a window between the two actions. Google's advanced recovery documentation describes the possibility of split brain during replica failover and treats planned switchover separately.
The failover drills started with zero observed replication lag and kept the original region reachable. That leaves two questions for a future exercise: what happens to accepted writes when the replica is already behind, and which applications can resume once the original region is unreachable?