Re: Bug? Concurrent COMMENT ON and DROP object

Поиск
Список
Период
Сортировка
От KaiGai Kohei
Тема Re: Bug? Concurrent COMMENT ON and DROP object
Дата
Msg-id 4C36ABFD.4060703@ak.jp.nec.com
обсуждение исходный текст
Ответ на Re: Bug? Concurrent COMMENT ON and DROP object  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Bug? Concurrent COMMENT ON and DROP object  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
(2010/07/07 11:31), Robert Haas wrote:
> On Tue, Jul 6, 2010 at 10:18 PM, Tom Lane<tgl@sss.pgh.pa.us>  wrote:
>> Robert Haas<robertmhaas@gmail.com>  writes:
>>> Obviously not.  We don't need to acquire an AccessExclusiveLock to
>>> comment on an object - just something that will CONFLICT WITH an
>>> AccessExclusiveLock.  So, use the same locking rules, perhaps, but
>>> take a much weaker lock, like AccessShareLock.
>>
>> Well, it probably needs to be a self-conflicting lock type, so that
>> two COMMENTs on the same object can't run concurrently.  But I agree
>> AccessExclusiveLock is too strong: that implies locking out read-only
>> examination of the object, which we don't want.
> 
> Hmm... so, maybe ShareUpdateExclusiveLock?  That looks to be the
> weakest thing that is self-conflicting.  The others are
> ShareRowExclusiveLock, ExclusiveLock, and AccessExclusiveLock.
> 
Is it necessary to confirm existence of the database object being
commented on after we got acquired the lock, isn't it?

Since the logic of AcquireDeletionLock() requires us to provide
argument as object-id form, but we have to translate the object
name into object-id outside of the critical section, so the object
being commented might be already dropped and committed before we
got acquired the lock.

Thanks,
-- 
KaiGai Kohei <kaigai@ak.jp.nec.com>


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Stamp HEAD as 9.1devel.
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: patch: preload dictionary new version