Re: PostgreSQL Replication Lag – WALs Streaming but Not Being Applied

From: Gyanuba Gyanuba <gyanubagyanuba(at)gmail(dot)com>
To: Simon Musila - Localhost <smusila1(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: PostgreSQL Replication Lag – WALs Streaming but Not Being Applied
Date: 2026-08-18 18:06:11
Message-ID: CAP7qGJ6CMQ7tNoL9kcA+FXK-RYfMSk67oQaOBb3FbX3pSEHBUg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Wait pending

On Tue, Aug 18, 2026, 11:34 PM Simon Musila - Localhost <smusila1(at)gmail(dot)com>
wrote:

> Hello,
>
> I would appreciate some guidance on an issue we are experiencing with
> PostgreSQL streaming replication.
>
> The standby appears to be *receiving/streaming WALs and is up to date
> with the primary*, but the WAL records are not being applied to the
> standby, resulting in an increasing replication/replay lag.
>
> We have confirmed that:
>
> - WALs are being streamed from the primary to the standby.
> - The WAL receiver appears to be active.
> - The standby is receiving the WALs, but the replay/apply process is
> not keeping up.
> - pg_stat_database_conflicts shows no conflicts.
> - pg_is_wal_replay_paused() returns false.
> - recovery_min_apply_delay is 0.
> - hot_standby_feedback is disabled.
>
> [image: Screenshot 2026-08-18 at 20.52.58.png]
>
> *My questions are:*
>
> 1. What could cause WALs to be successfully streamed to the standby
> but not applied/replayed?
> 2. What are the best steps to identify what the WAL replay process is
> waiting on?
> 3. Is restarting the replication/standby the only practical solution,
> or is there a way to safely resume WAL replay without restarting?
> 4. Are there specific PostgreSQL views, wait events, or system metrics
> that you would recommend checking to identify the bottleneck?
>
> I would appreciate any guidance on troubleshooting this and identifying
> the underlying cause rather than simply restarting the replication whenever
> this occurs.
>
> *NB: This happens on a daily basis!*
>
> Thank you in advance.
>
> Regards,
> Musila
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Avinash Vallarapu 2026-08-18 18:14:49 Re: PostgreSQL Replication Lag – WALs Streaming but Not Being Applied
Previous Message Gyanuba Gyanuba 2026-08-18 18:05:14 Re: Unused Indexes