Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r9FA6-00FVn2-97 for pgsql-hackers@arkaria.postgresql.org; Sat, 02 Dec 2023 01:51:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r9FA4-00A88A-PA for pgsql-hackers@arkaria.postgresql.org; Sat, 02 Dec 2023 01:51:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r9FA4-00A881-Fb for pgsql-hackers@lists.postgresql.org; Sat, 02 Dec 2023 01:51:16 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r9FA1-008MUx-Tt for pgsql-hackers@lists.postgresql.org; Sat, 02 Dec 2023 01:51:15 +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 3B21pBND307442; Fri, 1 Dec 2023 20:51:11 -0500 From: Tom Lane To: Andres Freund cc: Hao Zhang , pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] plpython function causes server panic In-reply-to: <301509.1701479055@sss.pgh.pa.us> References: <301509.1701479055@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 01 Dec 2023 20:04:15 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <307440.1701481871.1@sss.pgh.pa.us> Date: Fri, 01 Dec 2023 20:51:11 -0500 Message-ID: <307441.1701481871@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > The only readily-reachable error case in BeginInternalSubTransaction > is this specific one about IsInParallelMode, which was added later > than the original design and evidently with not a lot of thought or > testing. The comment for it speculates about whether we could get > rid of it, so I wonder if our thoughts about this ought to go in that > direction. After thinking a bit more I wonder why we need that error check at all. Why isn't it sufficient to rely on GetNewTransactionId()'s check that throws an error if a parallelized subtransaction tries to obtain an XID? I don't see why we'd need to "synchronize transaction state" about anything that never acquires an XID. regards, tom lane