Re: Why is lock not released? - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Why is lock not released?
Date
Msg-id 20050820042001.GA19457@surnet.cl
Whole thread Raw
In response to Re: Why is lock not released?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Why is lock not released?
List pgsql-hackers
On Fri, Aug 19, 2005 at 05:47:11PM -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> > On Fri, Aug 19, 2005 at 01:11:54PM -0400, Tom Lane wrote:
> >> The code's a bit inconsistent about whether it releases non-exclusive
> >> locks on system catalogs or leaves them till transaction end.  I suppose
> >> sometime we should try to make it consistent --- but as long as you're
> >> talking about non-exclusive locks, it doesn't really matter too much.
> 
> > Ok, I'll change it where I find reasonable in my "drop owned by" patch.
> > (The locks are RowExclusive).
> 
> Well, before you start changing stuff, we probably oughta decide on
> which way we want to make it consistent --- keep the locks always,
> or drop always?
> 
> The "drop" way probably allows slightly more concurrency, but given that
> people should seldom be taking exclusionary locks on system catalogs,
> I'm not sure this is really an issue.

Hmm.  The problem at hand (REASSIGN OWNED BY) may involve changing
ownership of several objects in a single transaction.  The order is
unspecified, because it's following a scan of the pg_shdepend entries --
so it'd be easy for one REASSIGN OWNED BY transaction to deadlock with
another one, if they happen to follow different orderings.

I'm not sure if this argument is strong enough to favor the balance to
the side of "drop always."  It seems that way to me.

-- 
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
"Si un desconocido se acerca y te regala un CD de Ubuntu ...                                    Eso es ...  Eau de
Tux"


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: obtaining row locking information
Next
From: Tom Lane
Date:
Subject: Re: Why is lock not released?