On Fri, Sep 27, 2019 at 12:54 AM Michael Paquier <mich...@paquier.xyz> wrote: > > On Thu, Sep 26, 2019 at 09:57:57AM -0700, legrand legrand wrote: > > Does that mean that all processes seen in pg_stat_activity like > > - autovacuum launcher > > - logical replication launcher > > - background writer > > - checkpointer > > - walwriter > > ... > > - Parallel worker > > are available with that hook (it seems not) ? > > All processes using PostgresMain() for their startup take this code > path like WAL senders and normal backend sessions, but not things > going through StartChildProcess() (WAL receiver, bgwriter, etc.) or > other processes like autovacuum processes which use a different start > code path.
There is another patchset submitted to this CF (https://commitfest.postgresql.org/24/2259/) that attempts to centralize all process startup to make use of the StartChildProcess entrypoint. The patchset then introduces a fork_process hook that would be hit by every backend type immediately after forking. Looking at your patch, it seems like there won't be too much conflict between the two, but I wonder if we can collaborate on the hook portion to achieve both of our goals? As noted in the related thread, I'm currently breaking out the centralization patch into separate pieces: one for the infrastructure change (including MyAuxProc adoption of the centralized startup), one for each process type, and one for the fork_process hook. The substance of the patchset will remain mostly the same if you want to take a look. I look forward to hearing your thoughts on the matter. Thanks, -- Mike Palmiotto https://crunchydata.com