Re: Auxiliary Processes and MyAuxProc

From: Mike Palmiotto <mike(dot)palmiotto(at)crunchydata(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Auxiliary Processes and MyAuxProc
Date: 2019-02-25 22:25:11
Message-ID: CAMN686GgzQM_HngdjeCLkwTiC2zDEP5uY04R8V_irGHRpyRVxA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 25, 2019 at 1:41 PM Mike Palmiotto
<mike(dot)palmiotto(at)crunchydata(dot)com> wrote:
>
> <snip>
> >
> > If memory serves, StartChildProcess already was an attempt to unify
> > the treatment of postmaster children. It's possible that another
> > round of unification would be productive, but I think you'll find
> > that there are random small differences in requirements that'd
> > make it messy.
>
> It kind of seemed like it, but I noticed the small differences in
> requirements, which made me a bit hesitant. I'll go ahead and see what
> I can do and submit the patch for consideration.

I'm considering changing StartChildProcess to take a struct with data
for forking/execing each different process. Each different backend
type would build up the struct and then pass it on to
StartChildProcess, which would handle each separately. This would
ensure that the fork type is set prior to InitPostmasterChild and
would provide us with the information necessary to do what we need in
the InitPostmasterChild_hook.

Attached is a patch to fork_process.h which shows roughly what I'm
thinking. Does this seem somewhat sane as a first step?

--
Mike Palmiotto
Software Engineer
Crunchy Data Solutions
https://crunchydata.com

Attachment Content-Type Size
fork-proc-type.patch text/x-patch 768 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul Ramsey 2019-02-25 22:38:28 Re: Allowing extensions to supply operator-/function-specific info
Previous Message David Steele 2019-02-25 22:09:34 Re: Remove Deprecated Exclusive Backup Mode