Hi Kirill,
I verified that a blocked role check does not hold TwoPhaseStateLock.
After cancellation, another session can still finish the prepared
transaction. So the problem I expected seems to be solved.
On 9 Nov 2026, Kirill Reshke wrote:
> SET ROLE regress_prepare_setonly;
> SET ROLE regress_prepare_owner;
session_user is still the regression superuser, so the second SET ROLE
does not check the member's SET permission.
Maybe use SET SESSION AUTHORIZATION instead?
Thank you!
Best regards, Andrey Borodin.