pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Manu <manuelreyesbravo@gmail.com>
To: Durgamahesh Manne <maheshpostgres9@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Subject: Re: Regarding huge logical slot lag between source and target
Date: Mon, 19 Oct 2026 10:49:42 -0300
Message-ID: <179241778241.500292.2129909254871640315@gmail.com> (raw)
In-Reply-To: <CAJCZko+HqX7hwixYDAUBL8xf-x_zd8WYguodTRyo0mGy_vCbRQ@mail.gmail.com>
References: <CAJCZko+HqX7hwixYDAUBL8xf-x_zd8WYguodTRyo0mGy_vCbRQ@mail.gmail.com>

Hi Durga,

> Now slot lag is very minimal.
> How did you rectify when same issue you faced rather than resync data
> from scratch.

Glad it is minimal now.

To be clear, I did not hit this on a production system -- I reproduced the
pattern in a lab to find the cause, so there was nothing to "rectify" there.
But that is the useful part: this kind of lag is a throughput deficit, not
corruption. The slot's restart_lsn is simply trailing confirmed_flush, so it
drains on its own once the subscriber catches up -- when the write load eases
or the bottleneck is removed. A resync only buys you anything when there is
real divergence on the subscriber, which this is not; it just resets the
clock and the lag comes back under the same load.

So if it grows again, the order is: find the bottleneck first (top on the
walsender on the source and on the apply worker on the target -- whichever is
near 100% of a core is the limit), then apply the matching lever: lower the
commit rate reaching the hot table, split the tables across several
subscriptions so more apply workers run in parallel, or give the subscriber
more CPU/IO. No resync needed.

Regards,
Manu






view thread (19+ messages)  latest in thread

Message-ID: <179241778241.500292.2129909254871640315@gmail.com>
Permalink:  ../179241778241.500292.2129909254871640315@gmail.com/
Also on:    postgresql.org/message-id/179241778241.500292.2129909254871640315@gmail.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: manuelreyesbravo@gmail.com, maheshpostgres9@gmail.com, laurenz.albe@cybertec.at, adrian.klaver@aklaver.com
  Subject: Re: Regarding huge logical slot lag between source and target
  In-Reply-To: <179241778241.500292.2129909254871640315@gmail.com>
  References: <CAJCZko+HqX7hwixYDAUBL8xf-x_zd8WYguodTRyo0mGy_vCbRQ@mail.gmail.com> <179241778241.500292.2129909254871640315@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox