Re: Add lookup table for replication slot invalidation causes

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: Add lookup table for replication slot invalidation causes
Дата
Msg-id CALj2ACWE3zZmYUre9_8vvsGXUzOhZODgw=M54Cc53S_LH3Q4-g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add lookup table for replication slot invalidation causes  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Add lookup table for replication slot invalidation causes  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On Wed, Feb 21, 2024 at 11:56 AM Michael Paquier <michael@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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Test to dump and restore objects left behind by regression
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: What about Perl autodie?