Re: SIREAD lock versus ACCESS EXCLUSIVE lock

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: simon(at)2ndquadrant(dot)com, drkp(at)csail(dot)mit(dot)edu, pgsql-hackers(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: SIREAD lock versus ACCESS EXCLUSIVE lock
Date: 2011-06-07 18:00:10
Message-ID: 4DEE672A.2030109@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 07.06.2011 20:42, Kevin Grittner wrote:
> Heikki Linnakangas<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>
>> It makes me a bit uncomfortable to do catalog cache lookups while
>> holding all the lwlocks.
>
> I think I've caught up with the rest of the class on why this isn't
> sane in DropAllPredicateLocksFromTableImpl, but I wonder about
> CheckTableForSerializableConflictIn. We *do* expect to be throwing
> errors in here, and we need some way to tell whether an index is
> associated with a particular heap relation. Is the catalog cache
> the right way to check that here, or is something else more
> appropriate?

Hmm, it's not as dangerous there, as you're not in the middle of
modifying stuff, but it doesn't feel right there either.

Predicate locks on indexes are only needed to lock key ranges, to notice
later insertions into the range, right? For locks on tuples that do
exist, we have locks on the heap. If we're just about to delete every
tuple in the heap, that doesn't need to conflict with any locks on
indexes, because we're deleting, not inserting. So I don't think we need
to care about index locks here at all, only locks on the heap. Am I
missing something?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-06-07 18:05:10 Re: BUG #6041: Unlogged table was created bad in slave node
Previous Message Tom Lane 2011-06-07 17:59:33 Re: Range Types and extensions