Re: bug in fast-path locking

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: bug in fast-path locking
Дата
Msg-id 11208.1333996944@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: bug in fast-path locking  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: bug in fast-path locking  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Apr 9, 2012 at 1:49 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Haven't looked at the code, but maybe it'd be better to not bump the
>> strong lock count in the first place until the final step of updating
>> the lock tables?

> Well, unfortunately, that would break the entire mechanism.  The idea
> is that we bump the strong lock count first.  That prevents anyone
> from taking any more fast-path locks on the target relation.  Then, we
> go through and find any existing fast-path locks that have already
> been taken, and turn them into regular locks.  Finally, we resolve the
> actual lock request and either grant the lock or block, depending on
> whether conflicts exist.

OK.  (Is that explained somewhere in the comments?  I confess I've not
paid any attention to this patch up to now.)  I wonder though whether
you actually need a *count*.  What if it were just a flag saying "do not
take any fast path locks on this object", and once set it didn't get
unset until there were no locks left at all on that object?  In
particular, it's not clear from what you're saying here why it's okay
to let the value revert once you've changed some of the FP locks to
regular locks.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Revisiting extract(epoch from timestamp)
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Regarding column reordering project for GSoc 2012