Re: Good name for new lock type for VACUUM? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Good name for new lock type for VACUUM?
Date
Msg-id 200106232211.f5NMB7r10929@candle.pha.pa.us
Whole thread Raw
In response to Re: Good name for new lock type for VACUUM?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Good name for new lock type for VACUUM?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> "Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> > Isn't it a better idea to have a separate 'SELF EXCLUSIVE' lock
> > which conflicts with only itself ?
> >> 
> >> *Only* itself?  What would that be useful for?
> 
> > Isn't VacuumLock = RowExclusiveLock  + SelfExclusiveLock 
> > for the table ?
> 
> Oh, I see, you're suggesting acquiring two separate locks on the table.
> Hmm.  There would be a risk of deadlock if two processes tried to
> acquire these locks in different orders.  That's not a big problem for
> VACUUM, since all processes would presumably be executing the same
> VACUUM code.  But it raises questions about just how useful this lock
> type would be in general-purpose use.  You could never acquire *only*
> this lock type, it'd have to be combined with something else, so it
> seems like any usage would have to be carefully examined for deadlocks.
> 
> Still, it's an interesting alternative.  Comments anyone?

SelfExclusiveLock is clear and can't be confused with other lock types.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: mlw
Date:
Subject: Working out of the box
Next
From: Tom Lane
Date:
Subject: Re: Good name for new lock type for VACUUM?