PostgreSQL / Backup & Recovery / Runbooks
Teknik Uygulama Rehbericritical15 dkpostgresql (14–18)
mysql (14–18)
sqlserver (14–18)
oracle (14–18)
Replication Lag & Replica Drift Incident Runbook
Triage procedure for replication delay, WAL/binlog queue accumulation, and read-replica desynchronization.
Prerequisites & Safety Rules:
DBA access on both Primary and Replica instancesNetwork throughput diagnostic tools
1
Determine Lag Volume and State
Identify whether the bottleneck is network transfer latency or replica disk I/O replay starvation.
-- PostgreSQL:
SELECT client_addr, state, sync_state, pg_wal_lsn_diff(pg_current_wal_lsn(), write_lsn) AS write_lag_bytes, pg_wal_lsn_diff(pg_current_wal_lsn(), replay_lsn) AS replay_lag_bytes FROM pg_stat_replication;
-- MySQL:
SHOW REPLICA STATUS\G2
Check for Blocking Long-Running Queries on Replica
Long analytical queries on read replicas can cause recovery conflicts, stalling WAL replay.
SELECT pid, now() - query_start AS duration, query FROM pg_stat_activity WHERE state != 'idle' AND (now() - query_start) > interval '2 minutes';3
Prevent Master Disk Exhaustion (Replication Slots)
An inactive replication slot retains WAL files on Primary. Drop stuck slots if master disk capacity reaches >90%.
SELECT slot_name, active, pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)) AS retained_wal FROM pg_stat_replication_slots;Community Benchmark & Contribution
Share Your Restore Drill Results or Experience
Contribute real-world RTO/RPO telemetry, PostgreSQL version, backup methodology, and obstacles encountered from your infrastructure to help build industry benchmarks.