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

Shlok Kyal <shlok.kyal.oss@gmail.com>

From: Shlok Kyal <shlok.kyal.oss@gmail.com>
To: "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>
Cc: shveta malik <shveta.malik@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, Amit Kapila <amit.kapila16@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Ashutosh Sharma <ashu.coek88@gmail.com>
Date: 2025-11-26T09:51:17Z
Lists: pgsql-hackers

Attachments

On Wed, 26 Nov 2025 at 14:23, Zhijie Hou (Fujitsu)
<houzj.fnst@fujitsu.com> wrote:
>
> On Wednesday, November 26, 2025 2:29 PM Shlok Kyal <shlok.kyal.oss@gmail.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

Thanks,
Shlok Kyal