Re: Commit 5a2fed911a broke parallel query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Commit 5a2fed911a broke parallel query
Date: 2024-12-23 17:12:53
Message-ID: 1408486.1734973973@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I wrote:
> In the security-team discussion that led up to 73c9f91a1, I'd been
> wondering why parallel worker start enforces any connection
> restrictions at all. If we'd like the use of parallelism to be
> more-or-less transparent, we shouldn't apply these checks,
> and not the !am_superuser ones in InitPostgres either.

That is, the way I'd prefer to attack this is something along the
lines of the attached, which just disables all those checks in
parallel workers (and reverts 73c9f91a1's hackery on am_superuser).

One big question this raises is whether any other sorts of background
processes should be treated similarly.

Another loose end is that I don't think the enforcement of
datconnlimit is very sane. CountDBBackends skips processes that say
AmBackgroundWorkerProcess, so logically those should be precisely the
ones that escape enforcement of datconnlimit, but it doesn't quite
work like that today. This patch at least puts parallel workers on
the right side of the line; but I think we have some cleanup to do
for other sorts of auxiliary processes.

I'm also wondering if we could revisit the need for
CheckMyDatabase's override_allow_connections parameter
and thereby remove INIT_PG_OVERRIDE_ALLOW_CONNS.

So all in all, this is just at the POC stage.

regards, tom lane

Attachment Content-Type Size
fix-parallel-worker-connection-checks-poc.patch text/x-diff 3.1 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Laurenz Albe 2024-12-23 17:39:33 Re: Commit 5a2fed911a broke parallel query
Previous Message Tom Lane 2024-12-23 15:35:36 Re: Commit 5a2fed911a broke parallel query