Re: [HACKERS] Patch to improve performance of replay of AccessExclusiveLock - Mailing list pgsql-hackers

From David Rowley
Subject Re: [HACKERS] Patch to improve performance of replay of AccessExclusiveLock
Date
Msg-id CAKJS1f9cRUJ-JTUTHD7sQnLCoZhD9x4oJ4z_MTUFS4okH=OshA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Patch to improve performance of replay of AccessExclusiveLock  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
On 18 March 2017 at 21:52, Simon Riggs <simon@2ndquadrant.com> wrote:
> 2. In LogAccessExclusiveLock() we can use GetCurrentTransactionId()
> rather than GetTopTransactionId(), so that we assign the lock to the
> subxid rather than the top xid. That could increase lock traffic, but
> less likely. It also solves the problem of early release when AELs
> held by subxids.
>
> (2) looks safe enough, so patch attached.

I might be missing something here, but what's the point in doing this
if we're not releasing the lock any earlier?

Going by the other patch you posted we're only recording if the top
level xact has an AEL, so we'll never try to release the locks at the
end of the subxact, since the new flag bit won't be set when the
subxact ends.

Seems it'll just be better to remove the dead code from
StandbyReleaseLockTree(), as that'll just mean one pass over the
RecoveryLockList when it comes to releasing it at the end the top
level transaction. Probably we'd want to just move all of
StandbyReleaseLocks()'s code into StandbyReleaseLockTree(), since the
StandbyReleaseLockTree() would otherwise just end up calling the
static function.

Probably I misunderstood this again. Let me know if that's the case.

-- David Rowley                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [HACKERS] [PATCH] Transaction traceability - txid_status(bigint)
Next
From: David Rowley
Date:
Subject: Re: [HACKERS] Patch to improve performance of replay of AccessExclusiveLock