Re: Adding an LWLockHeldByMe()-like function that reports if anybuffer content lock is held

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Adding an LWLockHeldByMe()-like function that reports if anybuffer content lock is held
Дата
Msg-id 20180419015358.GG957@paquier.xyz
обсуждение исходный текст
Ответ на Re: Adding an LWLockHeldByMe()-like function that reports if anybuffer content lock is held  (Peter Geoghegan <pg@bowt.ie>)
Ответы Re: Adding an LWLockHeldByMe()-like function that reports if anybuffer content lock is held  (Peter Geoghegan <pg@bowt.ie>)
Список pgsql-hackers
On Wed, Apr 18, 2018 at 06:44:00PM -0700, Peter Geoghegan wrote:
> What I have in mind here is something that's a bit like
> AssertNotInCriticalSection(). We don't need to pepper
> AssertNotInCriticalSection() everywhere in practice, because calling
> palloc() is a pretty good proxy for "function should not be called in
> a critical section" -- palloc() calls AssertNotInCriticalSection(),
> which probably catches most unsafe code in critical sections
> immediately.

In this case, the prospect of limiting unnecessary PANIC exists on OOM
was the deal breaker.

> We could probably also get decent
> Assert(!AnyBufferLockHeldByMe()) coverage without adding many new
> asserts.
>
> I'm curious about what we'll find by just by adding
> Assert(!AnyBufferLockHeldByMe()) to the top of
> heap_tuple_fetch_attr(). AssertNotInCriticalSection() certainly found
> several bugs when it was first added.

Yep.
--
Michael

Вложения

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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: ON CONFLICT DO UPDATE for partitioned tables
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Speedup of relation deletes during recovery