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 1nJN3t-0006yn-Ji for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Feb 2022 22:09:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nJN3s-0004s0-6r for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Feb 2022 22:09:40 +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 1nJN3r-0004rr-Ur for pgsql-bugs@lists.postgresql.org; Sun, 13 Feb 2022 22:09:39 +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 1nJN3p-0006ev-K4 for pgsql-bugs@lists.postgresql.org; Sun, 13 Feb 2022 22:09:38 +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 21DM9ZXH2735167; Sun, 13 Feb 2022 17:09:35 -0500 From: Tom Lane To: Masahiko Sawada cc: Dmitry Koval , Dilip Kumar , andrewbille@gmail.com, PostgreSQL mailing lists Subject: Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end In-reply-to: <2733419.1644789029@sss.pgh.pa.us> References: <17385-9ee529fb091f0ce5@postgresql.org> <6e31c4ef-de9a-960b-1a21-e3b6ff0fa9c2@postgrespro.ru> <2733419.1644789029@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 13 Feb 2022 16:50:29 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2735165.1644790175.1@sss.pgh.pa.us> Date: Sun, 13 Feb 2022 17:09:35 -0500 Message-ID: <2735166.1644790175@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hmm, here's a related anomaly: regression=# BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; BEGIN regression=*# savepoint foo; SAVEPOINT regression=*# RESET transaction_isolation; RESET regression=*# select 1; ?column? ---------- 1 (1 row) regression=*# show transaction_isolation; transaction_isolation ----------------------- read committed (1 row) regression=*# rollback to foo; ROLLBACK regression=*# show transaction_isolation; transaction_isolation ----------------------- serializable (1 row) regression=*# commit; COMMIT I'm not sure why that didn't fail, but it seems like it should've: the commit-time isolation level is different from what we were using when we took the first snapshot. (Maybe we discard the snapshot state when rolling back? Not sure.) If we need to be sure that it's always okay to roll back a (sub)transaction, then that's an additional constraint on what's valid for GUCs to do. Yet it'd be a really bad idea to run check_hooks during transaction rollback, so maybe there's little choice. regards, tom lane