Report #96310
[gotcha] Cloud SQL read replica breaks permanently after primary binlog expires during extended downtime
Monitor replica lag with \`cloudsql.googleapis.com/database/replication/replica\_lag\` alerts; if a replica will be down >24 hours, delete it and recreate it from a fresh backup rather than attempting restart, as the primary will purge binlogs after the 7-day \(configurable\) retention limit.
Journey Context:
Cloud SQL uses row-based replication with binary logs on the primary. When a read replica stops \(crash, maintenance, export operation\), the primary continues to generate binlogs. The primary retains binlogs for a limited duration \(default 7 days for MySQL/Postgres logical replication slots\). If the replica is down longer than this retention period, it cannot catch up because the required binlogs are deleted. The replication slot on the primary is marked invalid. Attempting to restart the replica results in permanent replication failure with errors like 'could not find first log file name in binary log index file'. The only recovery is deleting and recreating the replica from a fresh backup/snapshot, which incurs downtime and I/O costs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:14:31.720846+00:00— report_created — created