Re: New lock types - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: New lock types
Date
Msg-id 20021006200455.GA8845@atentus.com
Whole thread Raw
In response to Re: New lock types  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: New lock types
List pgsql-hackers
On Sat, Oct 05, 2002 at 08:25:35PM -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre@atentus.com> writes:
> >>> It seems to me I'll have to add some amount of lock types
> >>> in the lock manager.  Does that bother you?
> >> 
> >> Such as?
> 
> > There are three new lock modes: R, RX and RS (Reorganizer, Reorganizer
> > Exclusive and Reorganizer Shared).  Actually, they are not new lock
> > types; rather, new objects on which locks should be obtained before
> > using the index pages.
> 
> We've got a ton of lock modes already; perhaps these operations can be
> mapped into acquiring some existing lock modes on index pages?

I'll have a look.  Can't say right now.  Some of the locks have special
semantics on what to do when a conflicting request arrives.

> Yeah, you can't recycle pages without a freelist :-(.

In access/nbtree/README says that the metapage of the index "contains a
pointer to the list of free pages".  However I don't see anything like
that in the BTMetaPageData.  Should I suppose that it was ripped out
sometime ago?  I'll add it if that's the case.  Or maybe I'm looking at
the wrong place?


> Maybe the freelist head link can be treated as a separately lockable
> object.

I think creating a new LWLockId (BTFreeListLock?) can help here.  The
operations on freelist are short lived and rather infrequent so it
doesn't seem to matter that it is global to all indexes.  Another way
would be to create one LockId per index, but it seems a waste to me.

-- 
Alvaro Herrera (<alvherre[a]atentus.com>)
"No hay ausente sin culpa ni presente sin disculpa" (Prov. frances)


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proposed LogWriter Scheme, WAS: Potential Large
Next
From: Greg Copeland
Date:
Subject: Re: Proposed LogWriter Scheme, WAS: Potential Large