Re: synchronized_standby_slots behavior inconsistent with quorum-based synchronous replication

Ashutosh Sharma <ashu.coek88@gmail.com>

From: Ashutosh Sharma <ashu.coek88@gmail.com>
To: Japin Li <japinli@hotmail.com>
Cc: surya poondla <suryapoondla4@gmail.com>, SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-03-26T06:05:37Z
Lists: pgsql-hackers

Attachments

Hi Japin,

> Thanks for updating the patch.  A minor nitpick:
>
> 1.
> +typedef enum
> +{
> +       SS_SLOT_NOT_FOUND,              /* slot does not exist */
> +       SS_SLOT_LOGICAL,                /* slot is logical, not physical */
> +       SS_SLOT_INVALIDATED,    /* slot has been invalidated */
> +       SS_SLOT_INACTIVE,               /* slot is inactive (standby not connected) */
> +       SS_SLOT_LAGGING                 /* slot exists and is active but has not caught up */
> +} SyncStandbySlotsState;
>
> IIRC, trailing commas are now used after the last enum.
>

Yes, I could see that in some of the lately added enums. Thanks for
raising this point, it has been addressed in the attached patch.

> 2.
> +       slot_states = (SyncStandbySlotsStateInfo *)
> +               palloc(sizeof(SyncStandbySlotsStateInfo) * synchronized_standby_slots_config->nslotnames);
>
> With palloc_array() now available, it would be preferable.
>

Makes sense. The attached patch addresses this too.

--
With Regards,
Ashutosh Sharma.