Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jr0s1-0005aP-MT for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jul 2020 15:11:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jr0s0-0006HR-LU for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jul 2020 15:11:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jr0s0-0006HJ-Eb for pgsql-hackers@lists.postgresql.org; Thu, 02 Jul 2020 15:11:24 +0000 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jr0rx-0002zi-Pp for pgsql-hackers@postgresql.org; Thu, 02 Jul 2020 15:11:24 +0000 Received: by mail-qv1-xf43.google.com with SMTP id m9so12838968qvx.5 for ; Thu, 02 Jul 2020 08:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=cBpZZYUE0a/z+1hJd3PKPN6JDsRLrDKJ89mWOjHzaMQ=; b=JlOzPVFMiOC3uRcxR+/fkoJyuJz0a6A913R+KDImZ0wQaqveAVIbO2wbBLiT8tfqvX yKm0hfh8mK0e+wCiYQDlj2mtIkmlBirk+EyYqOLv5Cjbjd7ZRuY/q9faCX0cWncpOhC+ tCOG4N6D/rg0ApL+hfbVB9kWoVwNS9Hj87MhRIuW8nt0+tRvv6b6uGsuSDYtK7/PxLD9 ixdIeTg+84qHTq57KKM8G49pXs/7MXtx2cofCrSe6ClRQuucnBni41wDgJDXXMt2o2aB VMq3UphGaJ39pZ9VIeA8J0Z2bT9wLKEmQLeVsvWZQezjD0Nm3OsSaqTvXit7cd4eKYQR WTTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=cBpZZYUE0a/z+1hJd3PKPN6JDsRLrDKJ89mWOjHzaMQ=; b=ojzP93wKvTzvoVkfBh/kZX5wDH9GUSc/PpR1QIQd8AYbh0WGmdFwyyN/GnR0tlbb3s llfcZyqx6+TmGYHLM4Q9S2a3fsaUtEqBxuD/CwQ6FJumsMaVSBgzMijZSxaNqRkxNLNL rkS3Zg6uFlHRgAzrQYstU0n4onyeX7NCXxQVIdIku0iBTvXS5q5FEXFsxGchtu1919+M 2NdVPoreI6UzbYoKbIhJuXIXRBzDSUVcb203Q2teuIeYhEvV/EkcItfzzhftSrGWo/Fg H1tZWNwXOEEucnzITKOpruW/GznsqG/eNSjBN5hj0mSxxChj+EX9tRA263/mxEXicnf1 tV5Q== X-Gm-Message-State: AOAM533XPNxvedzVwoIRxIn1CsXXHNa6cnEuARQMq61wczrqadekA+e3 dUbT7Ct7jLT8M0IaM2bfwmMcGA== X-Google-Smtp-Source: ABdhPJxzLxlr/XZ7HUBfW/KI35lqsJ7GSRM2jLgE6IXRFq9UoZ0oCJHm653cGThDG9KEU2PzUljEiw== X-Received: by 2002:a0c:baa3:: with SMTP id x35mr7134899qvf.213.1593702679911; Thu, 02 Jul 2020 08:11:19 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id z1sm1554165qkl.74.2020.07.02.08.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 08:11:19 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D6F592A25A1; Thu, 2 Jul 2020 11:11:17 -0400 (-04) Date: Thu, 2 Jul 2020 11:11:17 -0400 From: Alvaro Herrera To: Mike Palmiotto Cc: Andres Freund , Peter Eisentraut , Justin Pryzby , Michael Paquier , Yuli Khodorkovskiy , Tom Lane , pgsql-hackers Subject: Re: Auxiliary Processes and MyAuxProc Message-ID: <20200702151117.GA4919@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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