Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end - Mailing list pgsql-bugs

From Masahiko Sawada
Subject Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end
Date
Msg-id CAD21AoCkwsb_Hz6JYbG0X8Jf_VEMheiib0FXpR2kc3UATVCPNQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end  (Dmitry Koval <d.koval@postgrespro.ru>)
Responses Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end
List pgsql-bugs
On Sat, Jan 29, 2022 at 12:26 AM Dmitry Koval <d.koval@postgrespro.ru> wrote:
>
> Hi,
>
> Additional information. Query
> "RESET transaction_isolation;"
> in previous message can be replaced to synonym
> "SET transaction_isolation=DEFAULT;"
> (error will be the same).
>
> I attached file with simple fix for branch "master".
>
> I not sure that need to use a separate block of code for the
> "transaction_isolation" GUC-variable. But this is a special variable
> and there are several places in the code with handling of this variable.

IIUC this problem comes from the fact that RESET command doesn't call
check_hook of GUC parameters. Therefore, all GUC parameters that don’t
expect to be changed after something operations are affected. For
example, in addition to transaction_isolation, we don’t support
changing transaction_read_only and default_transaction_deferrable
after the first snapshot is taken. Also, we don’t support changing
temp_buffers after accessing any temp tables in the session. But
RESET’ing these parameters bypasses the check. Considering these
facts, I think it’s better to call check_hook even in resetting cases.
I've attached a patch (with regression tests) for discussion.

Regards,

--
Masahiko Sawada
EDB:  https://www.enterprisedb.com/

Attachment

pgsql-bugs by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: BUG #17377: only superusers can query or manipulate replication origins
Next
From: Dilip Kumar
Date:
Subject: Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end