Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o - Mailing list pgsql-committers

From Andres Freund
Subject Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o
Date
Msg-id 20210809173453.6fugm2z7k6uaztld@alap3.anarazel.de
Whole thread Raw
In response to Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-committers
Hi,

On 2021-08-09 11:46:30 -0400, Robert Haas wrote:
> I think that subsystems like "memory" and "files" really ought to be
> the lowest-level things we have, and should be shut down last.

I don't disagree with that - but there's a difference between having that as
an abstract goal, and having it a dependency of committing somebodies patch.


> Stuff like "send a message to the stats collector" seems like a higher level
> thing that may require those lower-level facilities in order to operate, and
> must therefore be shut down first.

Yep.


> Maybe some subsystems need to be divided into upper and lower levels to make
> this work, or, well, I don't know, something else.

That's what I ended up doing, right? There's now InitFileAccess() and
InitTemporaryFileAccess().


> But I'm deeply suspicious that lifting stuff like this to the front of the
> shutdown sequence is just papering over the problem, and not actually
> solving it.

If you have a concrete proposal that you think makes sense to tie shared
memory stats to, I'm happy to entertain it. One main motivator for b406478b87e
etc was to allow rejiggering things like this more easily.

Greetings,

Andres Freund



pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o
Next
From: Tom Lane
Date:
Subject: pgsql: Last-minute updates for release notes.