Re: Bug in wait time when waiting on nested subtransaction

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in wait time when waiting on nested subtransaction
Date: 2022-11-28 18:53:10
Message-ID: 20221128185310.nfjtr2tbgj3tk6xi@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022-Nov-28, Simon Riggs wrote:

> A narrative description of the issue follows:
> session1 - requests multiple nested subtransactions like this:
> BEGIN; ...
> SAVEPOINT subxid1; ...
> SAVEPOINT subxid2; ...

> However, if subxid2 subcommits, then the lock wait moves from subxid2
> to the topxid.

Hmm, do we really do that? Seems very strange .. it sounds to me like
the lock should have been transferred to subxid1 (which is subxid2's
parent), not to the top-level Xid. Maybe what the user wanted was to
release subxid1 before establishing subxid2? Or do they want to
continue to be able to rollback to subxid1 after establishing subxid2?
(but why?)

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message walther 2022-11-28 18:56:56 Re: fixing CREATEROLE
Previous Message Nathan Bossart 2022-11-28 18:52:47 Re: predefined role(s) for VACUUM and ANALYZE