Re: Problem with synchronous replication

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Problem with synchronous replication
Дата
Msg-id 20191030130012.GD20808@paquier.xyz
обсуждение исходный текст
Ответ на Re: Problem with synchronous replication  (Fujii Masao <masao.fujii@gmail.com>)
Список pgsql-hackers
On Wed, Oct 30, 2019 at 05:21:17PM +0900, Fujii Masao wrote:
> This change causes every ending backends to always take the exclusive lock
> even when it's not in SyncRep queue. This may be problematic, for example,
> when terminating multiple backends at the same time? If yes,
> it might be better to check SHMQueueIsDetached() again after taking the lock.
> That is,
>
> if (!SHMQueueIsDetached(&(MyProc->syncRepLinks)))
> {
>     LWLockAcquire(SyncRepLock, LW_EXCLUSIVE);
>     if (!SHMQueueIsDetached(&(MyProc->syncRepLinks)))
>         SHMQueueDelete(&(MyProc->syncRepLinks));
>     LWLockRelease(SyncRepLock);
> }

Makes sense.  Thanks for the suggestion.
--
Michael

Вложения

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Unix-domain socket support on Windows
Следующее
От: Antonin Houska
Дата:
Сообщение: MarkBufferDirtyHint() and LSN update