pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Mike Palmiotto <mike.palmiotto@crunchydata.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Yuli Khodorkovskiy <yuli.khodorkovskiy@crunchydata.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Auxiliary Processes and MyAuxProc
Date: Thu, 2 Jul 2020 11:11:17 -0400
Message-ID: <20200702151117.GA4919@alvherre.pgsql> (raw)
In-Reply-To: <CAMN686G8DqKzc5JP8OHOsN0u3FBQOCBhTrCWnmCiE4G0m-arBQ@mail.gmail.com>

On 2020-Mar-26, Mike Palmiotto wrote:

Regarding 0001:

> diff --git a/src/backend/postmaster/subprocess.c b/src/backend/postmaster/subprocess.c
> new file mode 100644
> index 0000000000..3e7a45bf10
> --- /dev/null
> +++ b/src/backend/postmaster/subprocess.c
> @@ -0,0 +1,62 @@
> +/*-------------------------------------------------------------------------
> + *
> + * subprocess.c
> + *
> + * Copyright (c) 2004-2020, PostgreSQL Global Development Group
> + *
> + *
> + * IDENTIFICATION
> + *	  src/backend/postmaster/syslogger.c

Wrong file identification.

> +static PgSubprocess process_types[] = {
> +	{
> +		.desc = "checker",
> +		.entrypoint = CheckerModeMain
> +	},
> +	{
...

This array has to match the order in subprocess.h:

> +typedef enum
> +{
> +	NoProcessType = -1,
> +	CheckerType = 0,
> +	BootstrapType,
> +	StartupType,
> +	BgWriterType,
> +	CheckpointerType,
> +	WalWriterType,
> +	WalReceiverType,	/* end of Auxiliary Process Forks */
> +
> +	NUMSUBPROCESSTYPES			/* Must be last! */
> +} SubprocessType;

This sort of thing is messy and unfriendly to maintain.  I suggest we
use the same trick as in cmdtaglist.h and rmgrlist.h; see commits
2f9661311b83 and 5a1cd89f8f4a for examples.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (38+ messages)  latest in thread

Message-ID: <20200702151117.GA4919@alvherre.pgsql>
Permalink:  ../20200702151117.GA4919@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200702151117.GA4919@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, mike.palmiotto@crunchydata.com, andres@anarazel.de, peter.eisentraut@2ndquadrant.com, pryzby@telsasoft.com, michael@paquier.xyz, yuli.khodorkovskiy@crunchydata.com, tgl@sss.pgh.pa.us
  Subject: Re: Auxiliary Processes and MyAuxProc
  In-Reply-To: <20200702151117.GA4919@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox