cloudsql/WARN/2026_003

Cloud SQL replica instances do not have high replication lag

Product: CloudSQL
Rule class: WARN - Something that is possibly wrong

Description

Cloud SQL read replicas with high replication lag (> 600 seconds) might serve stale data or stop replicating from the primary database. High replication lag often indicates that the replica cannot keep up with the volume of changes being applied on the primary instance.

Remediation

High replication lag can be remediated by performing the following checks:

  1. Replica Sizing: Ensure the read replica has sufficient CPU and memory capacity. If the primary has been scaled up, ensure the replica is scaled up similarly.
  2. Write Workload: Reduce large batch operations or bulk inserts on the primary instance.
  3. Missing Indexes: For row-based replication (common in MySQL), ensure tables have primary keys or appropriate indexes. Missing indexes on the primary will cause replica updates to perform full table scans, severely lagging replication.
  4. Optimize Replica Queries: Ensure slow queries running directly on the read replica are not resource-starving the replication process.

Further information