Soru

Zorluk: OrtaManaging Storage and Database Solutions

A cloud administrator needs to promote an existing Cloud SQL read replica to an independent, standalone database instance to complete a planned regional workload separation. Arrange the operational steps in the correct chronological order to execute this promotion safely without data loss.

  1. 1Stop incoming write operations from application workloads to the primary Cloud SQL instance.
  2. 2Monitor Cloud SQL metrics to confirm that replication lag on the read replica has reached zero.
  3. 3Execute the command `gcloud sql instances promote-replica` for the target instance.
  4. 4Reconfigure application database connection strings to point to the IP address of the newly promoted standalone instance.

Cevap

The correct operational sequence is: 1) Stop incoming write operations from application workloads to the primary Cloud SQL instance, 2) Monitor Cloud SQL metrics to confirm that replication lag on the read replica has reached zero, 3) Execute the command `gcloud sql instances promote-replica` for the target instance, and 4) Reconfigure application database connection strings to point to the IP address of the newly promoted standalone instance.
To safely promote a Cloud SQL read replica without data loss, write operations to the primary instance must first be stopped. Next, administrators must verify that replication lag has dropped to zero so all committed transactions are reflected on the replica. Once synchronized, the promotion command is executed to convert the replica into a standalone instance. Finally, application configurations are updated to direct traffic to the new database endpoint.

Adım Adım Çözüm

1
Quiesce write operations on the primary database
The primary Cloud SQL instance ceases accepting new write transactions.
Prevents state divergence between the primary instance and the replica prior to promotion.
2
Verify replication synchronization
Replication lag metric drops to zero seconds.
Guarantees zero data loss by ensuring all queued write-ahead logs are fully processed by the replica.
3
Execute the promotion operation
The read replica transitions into an independent read/write instance.
Severing the replication topology enables the target database instance to process independent write operations.
4
Update application connection endpoints
Application connections are redirected to the new standalone Cloud SQL instance.
Restores full application connectivity to the newly independent database.

Anahtar Kavram

Cloud SQL Read Replica Promotion Procedure
Bu soruyu puanla