Re: SIREAD lock versus ACCESS EXCLUSIVE lock

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: "<Simon Riggs" <simon(at)2ndquadrant(dot)com>, "Dan Ports" <drkp(at)csail(dot)mit(dot)edu>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SIREAD lock versus ACCESS EXCLUSIVE lock
Date: 2011-06-03 21:02:04
Message-ID: 4DE9057C020000250003E144@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> On 03.06.2011 23:44, Kevin Grittner wrote:

>> Hmm. As mentioned earlier in the thread, cleaning these up
>> doesn't actually have any benefit beyond freeing space in the
>> predicate locking collections. I'm not sure that benefit is
>> enough to justify this much new mechanism. Maybe I should just
>> leave them alone and let them get cleaned up in due course with
>> the rest of the locks. Any opinions on that?
>
> Is there a chance of false positives if oid wraparound happens and
> a new table gets the same oid as the old one? It's also possible
> for a heap to get the OID of an old index or vice versa, will that
> confuse things?

Tuple locks should be safe from that because we use the tuple xmin
as part of the target key, but page and heap locks could result in
false positive serialization failures on OID wraparound unless we do
the cleanup. I guess that tips the scales in favor of it being
worth the extra code. I think it's still in that gray area where
it's a judgment call because it would be very infrequent and it
would be recoverable; but the fewer mysterious rollbacks, the fewer
posts about it we'll get. So any costs in maintaining the extra
code will probably be saved in reduced support, even if the
performance benefit is negligible.

-Kevin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2011-06-03 21:23:03 Re: Getting a bug tracker for the Postgres project
Previous Message Heikki Linnakangas 2011-06-03 20:50:40 Re: SIREAD lock versus ACCESS EXCLUSIVE lock