Re: should there be a hard-limit on the number of transactionspending undo? - Mailing list pgsql-hackers

From Andres Freund
Subject Re: should there be a hard-limit on the number of transactionspending undo?
Date
Msg-id 20190719201438.32g3cc444czmmxtz@alap3.anarazel.de
Whole thread Raw
In response to Re: should there be a hard-limit on the number of transactionspending undo?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 2019-07-19 15:57:45 -0400, Robert Haas wrote:
> On Fri, Jul 19, 2019 at 3:12 PM Andres Freund <andres@anarazel.de> wrote:
> > Isn't that pretty inherently required? How are otherwise ever going to
> > be able to roll back a transaction that holds an AEL on a relation it
> > also modifies?  I might be standing on my own head here, though.
> 
> I think you are.  If a transaction holds an AEL on a relation it also
> modifies, we still only need something like RowExclusiveLock to roll
> it back.  If we retain the transaction's locks until undo is complete,
> we will not deadlock, but we'll also hold AccessExclusiveLock for a
> long time.  If we release the transaction's locks, we can perform the
> undo in the background with only RowExclusiveLock, which is full of
> win.  Even you insist that the undo task should acquire the same lock
> the relation has, which seems entirely excessive to me, that hardly
> prevents undo from being applied.  Once the original transaction has
> released its locks, those locks are released, and the undo system can
> acquire those locks the next time the relation isn't busy (or when it
> gets to the head of the lock queue).

Good morning, Mr Freund. Not sure what you were thinking there.



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: should there be a hard-limit on the number of transactionspending undo?
Next
From: Tom Lane
Date:
Subject: Re: sepgsql seems rather thoroughly broken on Fedora 30