Re: Strange locking choices in pg_shdepend.c - Mailing list pgsql-hackers

From Decibel!
Subject Re: Strange locking choices in pg_shdepend.c
Date
Msg-id 20080123164931.GL37748@decibel.org
Whole thread Raw
In response to Strange locking choices in pg_shdepend.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Strange locking choices in pg_shdepend.c  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Jan 21, 2008 at 04:54:06PM -0500, Tom Lane wrote:
> It's probably not a good idea to have shdepReassignOwned() take only
> AccessShareLock on pg_shdepend.  Even though the function itself
> merely reads the table, it is going to call functions that will take
> RowExclusiveLock, meaning that we're setting ourselves up for potential
> deadlock failures due to lock-upgrade.  It'd be safer (and faster too)
> to just hold RowExclusiveLock through the whole operation.

Just a thought...

Would it be worthwhile to allow for logging when a lock gets upgraded?
That would make it easier to protect against deadlocks...
--
Decibel!, aka Jim C. Nasby, Database Architect  decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828

pgsql-hackers by date:

Previous
From: Decibel!
Date:
Subject: Re: Spoofing as the postmaster
Next
From: Decibel!
Date:
Subject: Re: [PATCHES] Better default_statistics_target