Re: Auxiliary Processes and MyAuxProc

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Mike Palmiotto <mike(dot)palmiotto(at)crunchydata(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Andres Freund <andres(at)anarazel(dot)de>, Yuli Khodorkovskiy <yuli(dot)khodorkovskiy(at)crunchydata(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Auxiliary Processes and MyAuxProc
Date: 2020-03-19 10:35:41
Message-ID: bc2a012a-c652-33a9-1fd7-5eaa0944ec2e@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-03-18 17:07, Mike Palmiotto wrote:
> On Wed, Mar 18, 2020 at 11:26 AM Mike Palmiotto
> <mike(dot)palmiotto(at)crunchydata(dot)com> wrote:
>>
>> On Wed, Mar 18, 2020 at 10:17 AM Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
>>> Also, I saw this was failing tests both before and after my rebase.
>>>
>>> http://cfbot.cputube.org/
>>> https://ci.appveyor.com/project/postgresql-cfbot/postgresql/builds/31535161
>>> https://ci.appveyor.com/project/postgresql-cfbot/postgresql/builds/31386446
>>
>> Good catch, thanks. Will address this as well in the next round. Just
>> need to set up a Windows dev environment to see if I can
>> reproduce/fix.
>
> While I track this down, here is a rebased patchset, which drops
> MySubprocessType and makes use of the MyBackendType.

While working on (My)BackendType, I was attempting to get rid of
(My)AuxProcType altogether. This would mostly work except that it's
sort of wired into the pgstats subsystem (see NumBackendStatSlots).
This can probably be reorganized, but I didn't pursue it further.

Now, I'm a sucker for refactoring, but I feel this proposal is going
into a direction I don't understand. I'd prefer that we focus around
building out background workers as the preferred subprocess mechanism.
Building out a second generic mechanism, again, I don't understand the
direction. Are we hoping to add more of these processes? Make it
extensible? The net lines added/removed by this patch series seems
pretty neutral. What are we getting at the end of this?

More specifically, I don't agree with the wholesale renaming of
auxiliary process to subprocess. Besides the massive code churn, the
old naming seemed pretty good to distinguish them from background
workers, the new naming is more ambiguous.

Btw., if I had a lot of time I would attempt to rewrite walreceiver and
perhaps the autovacuum system as background workers and thus further
reduce the footprint of the aux process system.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Atsushi Torikoshi 2020-03-19 10:39:33 Re: Wait event that should be reported while waiting for WAL archiving to finish
Previous Message Hubert Zhang 2020-03-19 10:29:19 Re: Print physical file path when checksum check fails