A Cloud Engineer is conducting a disaster recovery drill for a production regional Cloud SQL for PostgreSQL instance configured for High Availability (HA). The operational objective is to test manual failover from the primary zone to the standby zone, verify application stability, and safely failback to the original primary zone. Place the following operational steps in the correct chronological sequence required to execute this failover test.
- 1Execute `gcloud sql instances failover INSTANCE_NAME` to trigger a manual switchover to the standby instance.
- 2Run `gcloud sql operations list --instance=INSTANCE_NAME` and `gcloud sql operations describe OPERATION_ID` to confirm the failover state reaches `DONE`.
- 3Validate application health and database write availability against the active database endpoint while running in the secondary zone.
- 4Execute `gcloud sql instances failover INSTANCE_NAME` a second time to trigger failback and restore the instance to its primary zone.
Answer
The correct operational sequence is: 1) Initiate the manual failover command via gcloud; 2) Poll and confirm that the operation state reaches DONE; 3) Validate application connectivity and write operations in the failover zone; 4) Execute a second failover command to perform failback to the primary zone.
Testing High Availability (HA) failover in Cloud SQL requires a controlled sequence: initiating the failover using `gcloud sql instances failover`, monitoring the operation status until `DONE` using `gcloud sql operations describe`, validating application database operations in the failover zone, and finally triggering a second failover command to return the instance back to its original primary zone.
Step-by-Step Solution
Key Concept
Cloud SQL High Availability Manual Failover and Failback Testing