Re: pgsql: Harden new test case against force_parallel_mode = regress.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: Harden new test case against force_parallel_mode = regress.
Date: 2023-03-03 17:46:42
Message-ID: 2504511.1677865602@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Fri, Mar 3, 2023 at 11:37 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> +ERROR: role "regress_psql_user" does not exist
>> +CONTEXT: while setting parameter "session_authorization" to "regress_psql_user"

> Oh, that's interesting (and sad). A parallel worker has a "startup
> transaction" that is used to restore library and GUC state, and then
> after that transaction commits, it starts up a new transaction that
> uses the same snapshot and settings as the transaction in the parallel
> leader. So the problem here is that the startup transaction can't see
> the uncommitted work of some unrelated (as far as it knows)
> transaction, and that prevents restoring the session_authorization
> GUC.

Got it.

> That startup transaction has broken stuff before, and it would be nice
> to get rid of it. Unfortunately, I don't remember right now why we
> need it in the first place. I'm fairly sure that if you load the
> library and GUC state without any transaction, that doesn't work,
> because a bunch of important processing gets skipped. And I think if
> you try to do those things in the "real" transaction that fails for
> some reason too, maybe that there's no guarantee that all the relevant
> GUCs can be changed at that point, but I'm fuzzy on the details at the
> moment.

Couldn't we install the leader's snapshot into both transactions?

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2023-03-03 17:52:51 pgsql: Update some incorrect comments about xlog records.
Previous Message Robert Haas 2023-03-03 17:40:32 Re: pgsql: Harden new test case against force_parallel_mode = regress.

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema 2023-03-03 17:49:22 Re: libpq: PQgetCopyData() and allocation overhead
Previous Message Robert Haas 2023-03-03 17:40:32 Re: pgsql: Harden new test case against force_parallel_mode = regress.