Re: Why is lock not released?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Why is lock not released?
Дата
Msg-id 20050820042001.GA19457@surnet.cl
обсуждение исходный текст
Ответ на Re: Why is lock not released?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Why is lock not released?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: obtaining row locking information
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Why is lock not released?