public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jon Zeppieri <[email protected]>
To: Nick Cleaton <[email protected]>
Cc: [email protected]
Subject: Re: Possible causes of high_replay lag, given replication settings?
Date: Fri, 25 Jul 2025 09:57:30 -0400
Message-ID: <CAKfDxxxqWnf2Wb8dg2Ytx497aPpb-eFugxYVJfC=Pi8DaciXyg@mail.gmail.com> (raw)
In-Reply-To: <CAFgz3ksSB1OvN1ONDOO2qvhhF-FS7PXQTQtkDQYP_Y_pcvf+6g@mail.gmail.com>
References: <CAKfDxxwF03mouH7GqdZ0AqpGKz2wTj4T3F6ei_ubEQnNtErfGA@mail.gmail.com>
	<CAFgz3ksSB1OvN1ONDOO2qvhhF-FS7PXQTQtkDQYP_Y_pcvf+6g@mail.gmail.com>

On Wed, Jul 23, 2025 at 4:27 PM Nick Cleaton <[email protected]> wrote:
>
> On Fri, 18 Jul 2025 at 21:29, Jon Zeppieri <[email protected]> wrote:
> >
> > I just had a situation where physical replication fell far behind
> > (hours). The write and flush lag times were 0, but replay_lag was
> > high. The replica has hot_standby_feedback on, and both
> > max_standby_streaming_delay and max_standby_archive_delay are set to
> > 30s.
> >
> > What could cause a situation like this? If the network were a problem,
> > I'd expect the other _lag times to be high. So it appears that the
> > replica was getting the WAL but was unable to apply it. Are there
> > situations where the replica cannot apply WAL other than the kinds of
> > conflicts that would be addressed by the _delay settings?
> >
> > I checked pg_stat_database_conflicts, but there was nothing in it -- all zeros.
>
> This can happen when there are several busy writing processes on the
> primary. The single replay process on the replica can't keep up with
> the writes.

Thanks for the response, Nick. I'm curious why the situation you
describe wouldn't also lead to the write_lag and flush_lag also being
high. If the problem is simply keeping up with the primary, wouldn't
you expect all three lag times to be elevated?

- Jon






view thread (3+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Possible causes of high_replay lag, given replication settings?
  In-Reply-To: <CAKfDxxxqWnf2Wb8dg2Ytx497aPpb-eFugxYVJfC=Pi8DaciXyg@mail.gmail.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