replication-lag · shipping

Replication lag

Replication lag is a difference in replication progress between a source and a replica, measured at a named processing stage in a stated unit.

Related Observatory article: Read on hesela.com

Separate byte backlog from measured delay and identify receipt, write, flush or replay. PostgreSQL 18 pg_stat_replication lag intervals describe recent processing and notification delays, not a catch-up-time estimate. An idle caught-up standby can report NULL; NULL can also indicate missing tracking information, so it must not be replaced unconditionally with zero. [1] Slot restart_lsn is a retention horizon, not replay progress; confirmed_flush_lsn describes logical-consumer receipt and is NULL for physical slots. [4]

After a history fork, a numerical LSN difference alone does not show that one replica can catch up to the other. Establish compatible timeline ancestry before interpreting the distance as backlog. [5]

Relations

related
Synchronous replication, Asynchronous replication, Log sequence number, Storage latency, Replication slot, PostgreSQL timeline

Citations

  1. PostgreSQL 18: pg_stat_replication and lag semantics (accessed 2026-11-11)
  2. PostgreSQL 18: pg_replication_slots state and progress fields (accessed 2026-10-16)
  3. PostgreSQL 18: Timelines (accessed 2026-10-20)

Further reading

  1. PostgreSQL 18: WAL and recovery information functions (accessed 2026-10-12)
  2. Replication acknowledgements: received, durable, applied (accessed 2026-10-12)

JSON: /data/terms/replication-lag.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Replication lag. Hesela. 2026-11-11. https://hesela.dev/terms/replication-lag/