agora inbox for pgsql-admin@postgresql.org  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Simon Musila - Localhost <smusila1@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: PostgreSQL Replication Lag – WALs Streaming but Not Being Applied
Date: Wed, 19 Aug 2026 14:13:01 +0200
Message-ID: <aoWdzYaiyNCSZZ6V@depesz.com> (raw)
In-Reply-To: <CAEcumTPW5fDOFiv5yF8qDZCX2wVTUiR7KgNXu3Sc_dPE7sMRWA@mail.gmail.com>
References: <CAEcumTPW5fDOFiv5yF8qDZCX2wVTUiR7KgNXu3Sc_dPE7sMRWA@mail.gmail.com>

On Tue, Aug 18, 2026 at 09:03:39PM +0300, Simon Musila - Localhost wrote:
> *My questions are:*
>    1. What could cause WALs to be successfully streamed to the standby but
>    not applied/replayed?

Concurrent "traffic" (queries). Or special operations in wal that take
"a while" to apply.

>    2. What are the best steps to identify what the WAL replay process is
>    waiting on?

I'd start with:
a. `ps uwf -u postgres` shell command (as long as the underlying os is
   linux-ish.
b. `select * from pg_stat_activity`
c. `sudo strace -f -tt -T -s 256 -p PID-OF-PG-STARTUP-PROCESS` - again,
   on linux hosts
d. pg_waldump of the wal file that takes long time, and check what is
   going on there

Best regards,

depesz







view thread (5+ messages)

Message-ID: <aoWdzYaiyNCSZZ6V@depesz.com>
Permalink:  ../aoWdzYaiyNCSZZ6V@depesz.com/
Also on:    postgresql.org/message-id/aoWdzYaiyNCSZZ6V@depesz.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: depesz@depesz.com, smusila1@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: PostgreSQL Replication Lag – WALs Streaming but Not Being Applied
  In-Reply-To: <aoWdzYaiyNCSZZ6V@depesz.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox