Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. );

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. );
Дата
Msg-id CAB7nPqRj-fOpiUiDbiFR1rp62gF3gW+wUqt_tkWB1oVDmVfVOw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. );  (Andres Freund <andres@anarazel.de>)
Ответы Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. );  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. );  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Sat, Aug 1, 2015 at 9:20 PM, Andres Freund wrote:
> On August 1, 2015 2:17:24 PM GMT+02:00, Michael Paquier wrote:
>>> For instance, if you told me to choose between ShareLock and
>>> ShareUpdateExclusiveLock I wouldn't know which one is strongest.  I
>>> don't it's sensible to have the "lock mode compare" primitive
>>honestly.
>>> I don't have any great ideas to offer ATM sadly.
>>
>>Yes, the thing is that lowering the lock levels is good for
>>concurrency, but the non-monotony of the lock levels makes it
>>impossible to choose an intermediate state correctly.
>
> How about simply acquiring all the locks individually of they're different types? These few acquisitions won't
matter.

As long as this only applies on master, this may be fine... We could
basically pass a LOCKMASK to the multiple layers of tablecmds.c
instead of LOCKMODE to track all the locks that need to be taken, and
all the relations open during operations. Would it be worth having
some routines like relation_multi_[open|close]() as well? Like that:
Relation[] relation_multi_open(relation Oid, LOCKMASK):
void relation_multi_close(Relation[]);

If we do something, we may consider patching as well 9.5, it seems to
me that tablecmds.c is broken by assuming that lock hierarchy is
monotone in AlterTableGetLockLevel().
-- 
Michael



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

Предыдущее
От: Rajeev rastogi
Дата:
Сообщение: Re: Autonomous Transaction is back
Следующее
От: Piotr Stefaniak
Дата:
Сообщение: Re: [sqlsmith] Failed assertion in joinrels.c