Skip site navigation (1) Skip section navigation (2)

Re: Strange locking choices in pg_shdepend.c

From: Decibel! <decibel(at)decibel(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>,pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Strange locking choices in pg_shdepend.c
Date: 2008-01-23 16:49:31
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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(at)decibel(dot)org 
Give your computer some brain candy! Team #1828

In response to


pgsql-hackers by date

Next:From: Jonah H. HarrisDate: 2008-01-23 17:19:38
Subject: Re: [HACKERS] Including Snapshot Info with Indexes
Previous:From: Martijn van OosterhoutDate: 2008-01-23 16:48:49
Subject: Re: Thick indexes - a look at count(1) query

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group