Andres Freund <and...@anarazel.de> writes:
> When can PostmasterContext be NULL here, and why can we just continue without
> (re-)allocating PMChildInUse?

We'd only get into the !found stanza in a postmaster or a
standalone backend.  A standalone backend isn't ever going to call
AssignPostmasterChildSlot or ReleasePostmasterChildSlot, so it
does not need the array; and it also doesn't have a PostmasterContext,
so there's not a good place to allocate the array either.

Perhaps there's a better way to distinguish am-I-a-postmaster,
but I thought checking PostmasterContext is fine since that ties
directly to what the code needs to do.

Yes, the code would malfunction if the PostmasterContext != NULL
condition changed from one cycle to the next, but that shouldn't
happen.

                        regards, tom lane


Reply via email to