replication_lag_seconds
Replication lagDimensions:None
Available on:
Prometheus (1)
Interface Metrics (1)
Technical Annotations (12)
Configuration Parameters (3)
max_wal_sendersrecommended: 10max_replication_slotsrecommended: 10wal_compressionrecommended: onCLI Commands (1)
SELECT client_addr, state, sent_lsn, write_lsn, flush_lsn, replay_lsn, pg_wal_lsn_diff(sent_lsn, replay_lsn) AS replay_lag_bytes FROM pg_stat_replication;diagnosticTechnical References (8)
WALcomponentpostgres_exportercomponentpgwatchcomponentstreaming replicationconceptWAL sendercomponentreplication slotcomponentpg_stat_replicationcomponentWAL replayconceptRelated Insights (4)
CockroachDB Physical Replication Lag Threatening RPOwarning
Physical cluster replication lag (replication_lag) indicates the time gap between primary and standby clusters. Excessive lag means failover would result in data loss exceeding your Recovery Point Objective (RPO), threatening disaster recovery guarantees.
▸
Replication lag causes replica data staleness and read inconsistencieswarning
▸
Replication lag causes stale replica datacritical
▸
Replication lag causes stale reads on replicaswarning
Streaming replication lag between primary and replica nodes increases, causing replicas to serve stale data. High lag indicates replica cannot keep up with primary write volume, network issues, or resource constraints on replica.
▸