Re: What are exactly bootstrap processes, auxiliary processes, standalone backends, normal backends(user sessions)?

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Re: What are exactly bootstrap processes, auxiliary processes, standalone backends, normal backends(user sessions)?
Date: 2021-07-17 03:55:11
Message-ID: CALj2ACUtWWWLKAU_R3pryw7JvF1kS+EnBZq1XYSVsJ7ehKkRCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 15, 2021 at 8:17 PM Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
>
> On Fri, Jul 09, 2021 at 09:24:19PM +0530, Bharath Rupireddy wrote:
> > I've always had a hard time distinguishing various types of
> > processes/terms used in postgres. I look at the source code every time
> > to understand them, yet I don't feel satisfied with my understanding.
> > I request any hacker (having a better idea than me) to help me with
> > what each different process does and how they are different from each
> > other? Of course, I'm clear with normal backends (user sessions), bg
> > workers, but the others need a bit more understanding.
>
> It sounds like something that should be in the glossary, which currently refers
> to but doesn't define "auxiliary processes".

Thanks. I strongly feel that it should be documented somewhere. I will
be happy if someone with a clear idea about these various processes
does it.

> * Background writer, checkpointer, WAL writer and archiver run during normal
> * operation. Startup process and WAL receiver also consume 2 slots, but WAL
> * writer is launched only after startup has exited, so we only need 5 slots.
> */
> #define NUM_AUXILIARY_PROCS 5
>
> Bootstrap is run by initdb:
> src/bin/initdb/initdb.c: "\"%s\" --boot -x0 %s %s "
>
> Standalone backend is run by --single, right ?

Maybe(?). I found another snippet below:

if (argc > 1 && strcmp(argv[1], "--boot") == 0)
AuxiliaryProcessMain(argc, argv); /* does not return */
else if (argc > 1 && strcmp(argv[1], "--describe-config") == 0)
GucInfoMain(); /* does not return */
else if (argc > 1 && strcmp(argv[1], "--single") == 0)
PostgresMain(argc, argv,
NULL, /* no dbname */
strdup(get_user_name_or_exit(progname))); /*
does not return */
else
PostmasterMain(argc, argv); /* does not return */

Regards,
Bharath Rupireddy.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-07-17 04:24:07 Re: CREATE COLLATION - check for duplicate options and error out if found one
Previous Message David Rowley 2021-07-17 02:36:09 Re: Add proper planner support for ORDER BY / DISTINCT aggregates