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

From: Ajin Cherian <itsajin(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improve pg_sync_replication_slots() to wait for primary to advance
Date: 2025-10-02 11:23:34
Message-ID: CAFPTHDbNt7QOWQ+wmX9jZ2QrcBbKQH7P3hV=riBzcegHjhBaAQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 26, 2025 at 8:14 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
>
> It seems it is missed to be changed perhaps due to bringing back
> previous implementation of slotsync_api_reread_config()
>
> >
> > > b)
> > > There is double space in DETAIL msg: "have changed since"
> > >
> > > Will it be better to shorten the DETAIL as: 'One or more of
> > > primary_conninfo, primary_slot_name, or hot_standby_feedback were
> > > modified.'
> > >
> >
> > Changed.
> >

Fixed.

>
> This too is missed.
>
> > > 6)
> > > postgres=# SELECT pg_sync_replication_slots();
> > > ERROR: exiting from slot synchronization as promotion is triggered
> > >
> > > Shall we rephrase it similar to the previous message: 'cannot continue
> > > replication slots synchronization as standby promotion is triggered'
> > >
> > Changed.
> >
> > Attaching patch v14 incorporating the above changes.
> >
>

This was rephrased.

> Few trivial comments:
>
> 1)
> slotsync_api_reread_config():
> + * Returns true if conninfo, primary_slot_name or hot_standby_feedback changed.
>
> This comment is no longer valid, we can remove it.
>

Removed.

> 2)
> /* We are done with sync, so reset sync flag */
> reset_syncing_flag();
> +
>
> This extra blank line is not needed.

Fixed.

Attaching patch v15 addressing these comments.

regards,
Ajin Cherian
Fujitsu Australia

Attachment Content-Type Size
v15-0001-Improve-initial-slot-synchronization-in-pg_sync_.patch application/octet-stream 24.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Arseniy Mukhin 2025-10-02 12:06:38 Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue
Previous Message Daniel Verite 2025-10-02 11:11:13 Re: Problem in 'ORDER BY' of a column using a created collation?