From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: sawada.mshk@gmail.com
Cc: d.koval@postgrespro.ru
Cc: dilipbalaut@gmail.com
Cc: andrewbille@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end
Date: Mon, 14 Mar 2022 14:59:37 -0400
Message-ID: <212334.1647284377@sss.pgh.pa.us> (raw)
In-Reply-To: <170696.1647265517@sss.pgh.pa.us>
References: <CAD21AoA2sivebwQw9602CBf8URFWGKY0=qE6=2wDkm2YhRKnOw@mail.gmail.com>
<982894.1647028392@sss.pgh.pa.us>
<CAD21AoBpW8i8TfNoCm_iSxSZ8eZp_Tf10q1h-7wDmWCPiXGYYw@mail.gmail.com>
<20220314.173000.398225758850773114.horikyota.ntt@gmail.com>
<170696.1647265517@sss.pgh.pa.us>
After thinking about this some more, it seems like there is a related
problem with GUC save/restore actions. Consider
regression=# create function foo() returns int language sql as 'select 1'
regression-# set transaction_read_only = 1;
CREATE FUNCTION
regression=# begin;
BEGIN
regression=*# select foo();
foo
-----
1
(1 row)
regression=*# show transaction_read_only;
transaction_read_only
-----------------------
off
(1 row)
transaction_read_only was set while we executed foo(), but now it's
off again. I've not tried to weaponize this behavior, but if we
have any optimizations that depend on transaction_read_only, this
would probably break them. (SERIALIZABLE mode looks like a likely
candidate for problems.)
So it seems like we also need to forbid save/restore for these
settings, which probably means rejecting action==GUC_ACTION_SAVE
as well as value==NULL. That makes NO_RESET something of a misnomer,
but I don't have an idea for a better name.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, horikyota.ntt@gmail.com, sawada.mshk@gmail.com, d.koval@postgrespro.ru, dilipbalaut@gmail.com, andrewbille@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end
In-Reply-To: <212334.1647284377@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox