Re: Good name for new lock type for VACUUM?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Good name for new lock type for VACUUM?
Date: 2001-06-23 21:29:03
Message-ID: 8765.993331743@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)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?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-06-23 22:11:07 Re: Good name for new lock type for VACUUM?
Previous Message Hiroshi Inoue 2001-06-23 21:11:01 RE: Good name for new lock type for VACUUM?