Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Database Engineer practice bank has an additional 769 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your organization runs a latency-sensitive Cloud SQL for PostgreSQL database (db-primary) in us-central1 using asynchronous cross-region replication to minimize commit latency. You maintain two cross-region replicas:
db-west (us-west1): HA-enabled, matching machine type, Lag Bytes of 128 KB before outagedb-east (us-east1): Non-HA, smaller machine type, Lag Bytes of 15 MB before outageA regional outage makes us-central1 unavailable, and both replicas show a Replication state of Stopped.
Which sequence of actions should you execute to restore writes with minimal downtime and prevent data divergence?
db-west immediately without verifying WAL replay status, use gcloud sql instances patch to repoint db-east to replicate from db-west, and keep db-primary accessible in us-central1 to manually reconcile missed writes.This approach attempts to speed up recovery by skipping pre-promotion WAL checks, modifying an existing replica (db-east) via gcloud sql instances patch, and retaining db-primary for post-outage inspection.
db-west without verifying pg_last_wal_receive_lsn() against pg_last_wal_replay_lsn() risks cutting off WAL records that already arrived over the network from us-central1 but had not yet been applied to the database.db-east) and create a new read replica from db-west with a different instance name.db-primary accessible once us-central1 recovers allows stray or cached client connections to read stale data or write new transactions to db-primary, causing data divergence.Lag Bytes includes both un-transmitted data and data received by the replica that is awaiting replay; verifying replay LSN ensures all received data is preserved.db-west before opening it to clients establishes a known recovery baseline, rather than leaving db-primary exposed.You were using Cloud SQL Enterprise Plus Advanced DR, where a designated DR replica is promoted via replica failover, the DNS write endpoint automatically redirects clients, and Cloud SQL automatically reconfigures the former primary as a replica when it comes back online.
If you need to inspect or preserve state without risking split-brain, isolate db-primary from all client networks first, verify your new primary db-west with an immediate backup, and delete db-primary cleanly.
db-west using its regional standby configuration, retain existing client connection strings, and allow db-east to automatically re-attach as a replica of db-west.Cloud SQL High Availability (HA) provides automatic failover within a single region using a primary instance and a standby instance located in a separate zone. Data is synchronously replicated to a regional persistent disk, and if a zonal outage occurs, Cloud SQL automatically detects missed heartbeats and switches traffic to the standby instance using the same static IP address.
db-west protects db-west against a zonal failure inside us-west1, not against a regional outage of db-primary in us-central1. Cross-region replica promotion is always a manual and intentional operation.us-central1 connection strings.db-east) do not automatically re-parent to a newly promoted replica.The outage was confined to a single zone inside us-central1 rather than the entire region, allowing db-primary to fail over automatically to its in-region standby instance without changing client connection strings.
Enabling HA on db-west before a disaster is still a valuable best practice: once db-west is manually promoted, it is already protected against future zonal outages in us-west1, eliminating the time needed to configure HA after failover.
Replication state on db-west to return to Running and Lag Bytes to reach 0 before promotion, enable synchronous cross-region replication on db-west, and keep db-primary online for automatic failback.Replication state (cloudsql.googleapis.com/database/replication/state) and Lag Bytes measure the health and backlog of asynchronous replication between a primary and its read replicas. Synchronous replication requires every transaction commit to be confirmed by a remote copy before acknowledging the client, trading write latency for zero Recovery Point Objective (RPO).
us-central1 is unavailable, db-primary cannot send WAL records. Waiting for Replication state to return to Running and Lag Bytes to hit 0 blocks failover for the entire duration of the regional outage, violating the goal of minimal downtime.db-primary online after db-west is promoted risks clients accidentally reading stale data or writing conflicting transactions to db-primary when us-central1 recovers.Error or Stopped in Replication state is expected and indicates the exact point where replication halted.Lag Bytes window.You were executing a planned regional migration while us-central1 was completely healthy, where waiting for Replication state to show Running and Lag Bytes to reach 0 ensures zero data loss before promotion.
If an organization requires zero RPO across regions without manual split-brain management, a globally distributed synchronous database such as Spanner should be evaluated rather than Cloud SQL cross-region replicas.
db-west has replayed all received WAL records, promote db-west to a standalone primary, redirect clients to db-west, block access to and delete db-primary upon region recovery, and delete db-east to recreate a new replica from db-west with a new name.Cross-region replica promotion converts an asynchronous read replica in a secondary region into a standalone, writable primary instance. Because cross-region replication avoids the high network round-trip latency of synchronous commits across regions, it keeps normal write performance fast while providing regional disaster recovery.
db-west): db-west had only 128 KB in Lag Bytes (versus 15 MB on db-east), matches db-primary's machine tier to handle full production load, and already has HA enabled in us-west1—significantly reducing Recovery Time Objective (RTO).pg_catalog.pg_last_wal_receive_lsn() and pg_catalog.pg_last_wal_replay_lsn() verifies that db-west has applied every Write-Ahead Log (WAL) record it received before the outage halted replication.db-west makes it writable, and updating client connection strings directs application traffic to us-west1.db-primary and deleting it once us-central1 recovers prevents a split-brain state where clients write to two divergent primaries.db-east and creating a new cross-region replica from db-west using a different instance name re-establishes multi-region redundancy.us-central1 without waiting for cross-continent acknowledgments.db-west to match db-primary prevents CPU or I/O bottlenecks during and after failover.db-west is already HA-enabled, it is immediately protected against zonal outages in us-west1.Waiting for Lag Bytes to hit zero during a full regional outage is impossible, and skipping WAL replay checks or leaving db-primary accessible risks data loss and split-brain corruption. This sequence executes a clean, textbook cross-region failover while preserving low latency and long-term availability.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated