On Tue, Dec 5, 2023 at 12:31 AM Tristan Partin <tris...@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