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.
An application uses an AlloyDB for PostgreSQL cluster with a read pool instance configured with CPU-utilization-based autoscaling. During a traffic surge, the autoscaler scales the read pool from 2 to 6 nodes, yet performance degrades. Monitoring reveals the following:
HighLagThrottle.What should you do to distribute the read workload across all nodes and reduce replication lag?
The google_storage.log_replay_throttle_read_transactions flag controls whether AlloyDB throttles read queries on read pool nodes when replication lag exceeds one second. With its default value of on, AlloyDB pauses new read queries and buffer reads for up to one minute—visible as the HighLagThrottle wait event—to give the WAL replay process the resources needed to catch up.
HighLagThrottle filter on alloydb.googleapis.com/instance/postgresql/wait_count and wait_time metrics, or by checking postgres.log for Delayed.*due to replica lag messages.Your application is not sensitive to replication lag and can tolerate stale reads, and your primary objective is to prevent HighLagThrottle pauses from increasing read query latency during temporary replication delays.
In AlloyDB for PostgreSQL, a read pool instance exposes a single load-balanced IP endpoint that distributes incoming client connections across its underlying nodes. However, read pool autoscaling does not terminate existing long-lived connections when it provisions additional nodes. Periodically recycling connections in the application's connection pool closes older sessions and establishes new ones, allowing the load balancer to route traffic across the entire scaled pool.
HighLagThrottle wait events cease pausing incoming queries, restoring both data freshness and query responsiveness.Tuning database flags or compressing WAL records does not address why 4 of the 6 read pool nodes are idle. Recycling long-lived connections directly resolves connection affinity after scale-out, balancing CPU utilization across all nodes and eliminating the resource bottleneck causing replay lag.
The wal_compression flag compresses full-page-writes records in the Write-Ahead Log (WAL) on the primary instance before they are sent to read replicas. Enabling this flag requires zero downtime and no restart, reducing network and disk I/O during replication at the cost of a small amount of additional CPU overhead on the primary instance.
wal_compression only compresses full-page-writes records and has no impact on most routine WAL records.Replication lag increased specifically during a ScaNN index build or heavy full-page-write activity that saturated network or disk I/O between the primary instance and the read pool.
The max_standby_streaming_delay parameter determines how long the WAL replay process waits (defaulting to 30 seconds) before canceling active read queries that are blocking replication updates. Reducing this threshold forces the replica to terminate conflicting queries sooner so WAL replay can proceed.
canceling statement due to conflict with recovery in postgres.log. In this scenario, replay is slowed by CPU pressure and uneven load distribution, as evidenced by HighLagThrottle events rather than recovery conflict errors.max_standby_streaming_delay increases the rate of canceled read queries, disrupting application stability.alloydb.promote_cancel_to_terminate (enabled by default) to forcefully terminate unresponsive query backends.Logs in Logs Explorer showed canceling statement due to conflict with recovery messages caused by long-running queries holding locks or buffer pins that blocked WAL replay.
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