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 1pY9UW-0000PO-46 for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Mar 2023 17:46:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pY9UU-0001v6-Hd for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Mar 2023 17:46:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY9UU-0001ux-81 for pgsql-hackers@lists.postgresql.org; Fri, 03 Mar 2023 17:46:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY9UR-0007v5-Vb for pgsql-hackers@postgresql.org; Fri, 03 Mar 2023 17:46:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 323HkgRO2504512; Fri, 3 Mar 2023 12:46:42 -0500 From: Tom Lane To: Robert Haas cc: "pgsql-hackers@postgresql.org" Subject: Re: pgsql: Harden new test case against force_parallel_mode = regress. In-reply-to: References: <2478846.1677861476@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Fri, 03 Mar 2023 12:40:32 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2504510.1677865602.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 03 Mar 2023 12:46:42 -0500 Message-ID: <2504511.1677865602@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > On Fri, Mar 3, 2023 at 11:37=E2=80=AFAM Tom Lane wro= te: >> +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