On Wed, Feb 21, 2024 at 11:56 AM Michael Paquier <mich...@paquier.xyz> wrote:
>
> Note the recent commit 74a730631065 where Alvaro has changed for the
> lwlock tranche names.  That's quite elegant.

Yes, that's absolutely neat. FWIW, designated initializer syntax can
be used in a few more places though. I'm not sure how much worth it
will be but I'll see if I can quickly put up a patch for it.

> > With these two asserts, the behavior (asserts on null and non-existent
> > inputs) is the same as what GetSlotInvalidationCause has right now.
>
> Well, I won't fight you over that.

Haha :)

> A new cause would require an update of SlotInvalidationCause, so if
> you keep RS_INVAL_MAX_CAUSES close to it that's impossible to miss.
> IMO, it makes just more sense to keep that in slot.c because of the
> static assert as well.

Hm, okay. Moved that to slot.c but left a note in the comment atop
enum to update it.

> + * If you add a new invalidation cause here, remember to add its name in
> + * SlotInvalidationCauses in the same order as that of the cause.
>
> The order does not matter with the way v2 does things with
> SlotInvalidationCauses[], no?

Ugh. Corrected that now.

Please see the attached v3 patch.

-- 
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment: v3-0001-Add-lookup-table-for-replication-slot-invalidatio.patch
Description: Binary data

Reply via email to