Re: How can end users know the cause of LR slot sync delays?

From: Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>
To: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: shveta malik <shveta(dot)malik(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
Subject: Re: How can end users know the cause of LR slot sync delays?
Date: 2025-11-27 03:55:23
Message-ID: CANhcyEXWcyLHhbOGORQuuUix=rBFRAXP4h68NULxr-j9_qN99Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 26 Nov 2025 at 15:21, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com> wrote:
>
> On Wed, 26 Nov 2025 at 14:23, Zhijie Hou (Fujitsu)
> <houzj(dot)fnst(at)fujitsu(dot)com> wrote:
> >
> > On Wednesday, November 26, 2025 2:29 PM Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com> wrote:
> > > I have also addressed the remaining comments and attached the updated
> > > patch.
> >
> > Thanks for updating the patch, I have few comments:
> >
> > 1.
> > +/*
> > + * Map a SlotSyncSkipReason enum to a human-readable string
> > + */
> > +static char *
> > +GetSlotSyncSkipReasonName(SlotSyncSkipReason reason)
> >
> > Shall we add a static array to map the Enum value to the reason name
> > instead of adding the following function ?
> >
> I think static array would be more clean and consistent with
> ConflictTypeNames and SlotInvalidationCauses.
> Made the changes for same.
>
> > 2.
> > + <literal>remote_behind</literal> means that the slot is ahead of the
> > + corresponding failover slot on the primary.
> >
> > I think the current naming and doc is not easy for user to understand. So, I
> > suggest mentioning the explicit reason of this skip, e.g., the required WALs and
> > rows are removed or at the risk of removal. We can rename this reason to
> > "wal_or_rows_removed" and make the document similar to the content in
> > logicaldecoding.sgml.
> >
> I agree. Included the changes for same.
>
> I have also addressed the comments by Shveta in [1].
> [1]: https://www.postgresql.org/message-id/CAJpy0uDKC0QubC0pL%3DbZ4Qnq3eQbykLnFu5x%3DwmDkOmL44QL7g%40mail.gmail.com

I have made some minor changes in documentation and comments. Attached
the updated patch.

Thanks,
Shlok Kyal

Attachment Content-Type Size
v15-0001-Add-slotsync_skip_reason-to-pg_replication_slots.patch application/octet-stream 15.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-11-27 04:04:43 Re: Partial hash index is not used for implied qual.
Previous Message Pavel Stehule 2025-11-27 03:51:17 Re: [PATCH] psql: add size-based sorting options (O/o) for tables and indexes