Re: Improve pg_sync_replication_slots() to wait for primary to advance

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Ajin Cherian <itsajin(at)gmail(dot)com>, Yilin Zhang <jiezhilove(at)126(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Japin Li <japinli(at)hotmail(dot)com>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Improve pg_sync_replication_slots() to wait for primary to advance
Date: 2026-03-05 09:29:50
Message-ID: CAJpy0uCPjkg_dJaFdgZzDVbKgSf8Wg1SMFDwD+0xq2Mfn+4WEw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 5, 2026 at 12:25 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> >
> > patch001 has:
> >
> > - logical decoding and must be dropped after promotion. See
> > + logical decoding and must be dropped after promotion. This function
> > + retries cyclically until all the failover slots that existed on
> > + primary at the start of the function call are synchronized. See
> >
> > IIUC, this is not completely true though. If the slot is persisted, we
> > do not try cyclically now, we skip the sync. Isn't it?
> >
>
> Right, but even if one of the slots is not persisted, it will try to
> sync again, no?

yes, it will.

> Shall this be
> > changed to:
> >
> > It retries cyclically until all the failover slots that existed on
> > primary at the start of the function call are persisted and are
> > sync-ready.
> >
>
> This is too internal specific. I find Hou-san's version better w.r.t
> user facing docs.
>

Okay, works for me.

thanks
Shveta

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2026-03-05 09:35:42 Re: Skipping schema changes in publication
Previous Message Antonin Houska 2026-03-05 09:29:41 Dead code in logical decoding of speculative insertions