Re: Resource Owner reassign Locks - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: Resource Owner reassign Locks
Date
Msg-id CAMkU=1xPFV1erkRNwdxM41B0P+u2UTfnw9Ze2jaEidif=-pKRQ@mail.gmail.com
Whole thread Raw
In response to Re: Resource Owner reassign Locks  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Resource Owner reassign Locks  (Andres Freund <andres@anarazel.de>)
Re: Resource Owner reassign Locks  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Thu, Jun 21, 2012 at 5:32 AM, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote:
On 18.06.2012 13:59, Heikki Linnakangas wrote:
On 10.06.2012 23:39, Jeff Janes wrote:
I found the interface between resowner.c and lock.c a bit confusing.
resowner.c would sometimes call LockReassignCurrentOwner() to reassign
all the locks, and sometimes it would call LockReassignCurrentOwner() on
each individual lock, with the net effect that's the same as calling
LockReleaseCurrentOwner(). And it doesn't seem right for
ResourceOwnerRemember/ForgetLock to have to accept a NULL owner.

I rearranged that so that there's just a single
LockReassignCurrentOwner() function, like before this patch. But it
takes as an optional argument a list of locks held by the current
resource owner. If the caller knows it, it can pass them to make the
call faster, but if it doesn't it can just pass NULL and the function
will traverse the hash table the old-fashioned way. I think that's a
better API.

Please take a look to see if I broke something.

I hear no complaints, so committed. Thanks!

I'd like to advocate for back-patching this to 9.0, 9.1, and 9.2.  It has run without problems for a while now, and it can be considered a bug that systems with a very large number of objects cannot be upgraded in a reasonable time.

There are possible ways to make the upgrade smoother by changing the new systems pg_upgrade rather the old systems server, but those methods will not be simpler, and not be as well tested.

I'll add this proposal to the commit fest.

Thanks,

Jeff

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: PoC: Partial sort
Next
From: Andres Freund
Date:
Subject: Re: Resource Owner reassign Locks