Re: Rename ShmemVariableCache and initialize it in more standard way

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: Rename ShmemVariableCache and initialize it in more standard way
Дата
Msg-id CAMbWs49UvmEqtZm5B9Xw_9Y0j0CUq26j-kj+8_1KbpELM0ZTGg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Rename ShmemVariableCache and initialize it in more standard way  ("Tristan Partin" <tristan@neon.tech>)
Ответы Re: Rename ShmemVariableCache and initialize it in more standard way
Список pgsql-hackers

On Tue, Dec 5, 2023 at 12:31 AM Tristan Partin <tristan@neon.tech> wrote:
On Mon Dec 4, 2023 at 6:49 AM CST, Heikki Linnakangas wrote:
> This came up in the "Refactoring backend fork+exec code" thread recently
> [0], but is independent of that work:
>
> Here's a patch to allocate and initialize it with a pair of ShmemSize
> and ShmemInit functions, like all other shared memory structs.
>
>  +        if (!IsUnderPostmaster)
>  +        {
>  +                Assert(!found);
>  +                memset(ShmemVariableCache, 0, sizeof(VariableCacheData));
>  +        }
>  +        else
>  +                Assert(found);

Should the else branch instead be a fatal log?

The Assert here seems OK to me.  We do the same when initializing
commitTsShared/MultiXactState.  I think it would be preferable to adhere
to this convention.
 
Patches look good to me.

Also +1 to the patches.

Thanks
Richard

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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Optimizing nbtree ScalarArrayOp execution, allowing multi-column ordered scans, skip scan
Следующее
От: Nathan Bossart
Дата:
Сообщение: introduce dynamic shared memory registry