Re: Add assertion on held AddinShmemInitLock in GetNamedLWLockTranche()

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Add assertion on held AddinShmemInitLock in GetNamedLWLockTranche()
Дата
Msg-id ZNTBVSMm4LU0/q4w@paquier.xyz
обсуждение исходный текст
Ответ на Re: Add assertion on held AddinShmemInitLock in GetNamedLWLockTranche()  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
On Fri, Jul 28, 2023 at 11:07:49AM +0530, Bharath Rupireddy wrote:
> Why to block multiple readers (if at all there exists any), with
> LWLockHeldByMeInMode(..., LW_EXCLUSIVE)? I think
> Assert(LWLockHeldByMe(AddinShmemInitLock)); suffices in
> GetNamedLWLockTranche.

I am not sure to follow this argument.  Why would it make sense for
anybody to use that in shared mode?  We document that the exclusive
mode is required because we retrieve the lock position in shmem that
an extension needs to know about when it initializes its own shmem
state, and that cannot be done safely without LW_EXCLUSIVE.  Any
extension I can find in https://codesearch.debian.net/ does that as
well.
--
Michael

Вложения

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

Предыдущее
От: Matthias van de Meent
Дата:
Сообщение: Re: [question] multil-column range partition prune
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [PATCH] Add loongarch native checksum implementation.