Soru

Zorluk: ZorManaging Storage and Database Solutions

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.

  1. 1Execute `gcloud sql instances failover INSTANCE_NAME` to trigger a manual switchover to the standby instance.
  2. 2Run `gcloud sql operations list --instance=INSTANCE_NAME` and `gcloud sql operations describe OPERATION_ID` to confirm the failover state reaches `DONE`.
  3. 3Validate application health and database write availability against the active database endpoint while running in the secondary zone.
  4. 4Execute `gcloud sql instances failover INSTANCE_NAME` a second time to trigger failback and restore the instance to its primary zone.

Cevap

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.

Adım Adım Çözüm

1
Issue manual failover trigger
Cloud SQL initiates an explicit failover operation from the primary zone to the secondary standby zone.
The failover command `gcloud sql instances failover` explicitly commands GCP to serve traffic from the standby replica.
2
Monitor operational status
Operation status transitions from RUNNING to DONE.
Cloud SQL operations are asynchronous. Verification prevents testing against an instance during DNS propagation or state transition.
3
Perform application validation
Database health, read/write workloads, and connection pools are confirmed operational.
The core objective of a disaster recovery drill is to verify application resilience under secondary zone conditions.
4
Execute failback operation
The instance transitions back to its original primary zone.
To complete the drill cleanly, traffic must be returned to the designated default primary location.

Anahtar Kavram

Cloud SQL High Availability Manual Failover and Failback Testing
Bu soruyu puanla