Re: Reducing some DDL Locks to ShareLock - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Reducing some DDL Locks to ShareLock
Date
Msg-id 1226354882.27904.310.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: Reducing some DDL Locks to ShareLock  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Reducing some DDL Locks to ShareLock  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, 2008-11-09 at 20:18 -0500, Tom Lane wrote:
> Simon Riggs <simon@2ndQuadrant.com> writes:
> > Will think some more and report back.
> 
> If you want to do some more development, here's the portion of the
> patch as yet unapplied --- will save you extracting it for yourself.

Thanks.

More thought tells me that we should have a
LockRelationForCatalogUpdate() that uses nearly the same design pattern
as LockRelationForExtension(). There is no lockmode since we always take
the lock in exclusive mode.

Callers would grab the catalog update lock, re-read catalog, assemble
the new tuple, make in-place update and release lock. Lock is
non-transactional and exists only to serialise catalog updates from
concurrent DDL operations.

We then have the rule that all callers of heap_inplace_update() must
already hold the catalog update lock.

You like?

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support



pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Block-level CRC checks
Next
From: Alvaro Herrera
Date:
Subject: Re: Block-level CRC checks