Replication

Apply lag

Also called: replay lag

Apply lag (replay lag) is the gap between WAL a standby has received and WAL it has actually applied. On a healthy replica it's tiny; on a delayed standby it's held large on purpose. You can see it as the distance between pg_last_wal_receive_lsn() and pg_last_wal_replay_lsn().

What this means

The gap between WAL a standby has received and WAL it has actually applied. On a healthy replica it's a sliver; on a delayed standby it's held wide open on purpose. You read it as the distance between "last WAL received" and "last WAL replayed."

Why it matters operationally

Apply lag is distinct from receive lag: a standby can be fully caught up on receiving WAL (no data-loss risk) yet far behind on applying it. Read queries see the replayed state, so apply lag is what determines how stale a replica's reads are.

Related & next

Cascading replication and delayed standbys explainedReplication lag, the receive-side counterpartDelayed standby, where apply lag is intentional

Mentioned from

← All glossary terms · GUC reference · Error catalog