Re: Why is lock not released?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why is lock not released?
Date: 2005-08-19 21:47:11
Message-ID: 4250.1124488031@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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. The "keep" way might be a little
quicker, at least for catalogs that are touched more than once per xact
(since retaking a lock we already hold does not touch shared memory
anymore). I'm not sure I see an argument either way as concerns
code clarity. Comments?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-08-19 21:49:15 Beta timing
Previous Message Bruce Momjian 2005-08-19 20:56:18 enable_constraint_exclusion GUC name