Re: Hooks for session start and end, take two

From: Mike Palmiotto <mike(dot)palmiotto(at)crunchydata(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: legrand legrand <legrand_legrand(at)hotmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hooks for session start and end, take two
Date: 2019-09-27 19:01:39
Message-ID: CAMN686GTk7AUAmjsioedN6xOOYtbHXcxawUA7a9YL+kXP+trAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 27, 2019 at 12:54 AM Michael Paquier <michael(at)paquier(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-09-27 19:17:36 Re: Attempt to consolidate reading of XLOG page
Previous Message David Steele 2019-09-27 18:52:54 Skip recovery/standby signal files in pg_basebackup