Re: Problem with synchronous replication

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: Problem with synchronous replication
Дата
Msg-id 20191030.174304.523404903817205414.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Re: Problem with synchronous replication  (Fujii Masao <masao.fujii@gmail.com>)
Ответы Re: Problem with synchronous replication  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Hello.

At Wed, 30 Oct 2019 17:21:17 +0900, Fujii Masao <masao.fujii@gmail.com> wrote in 
> 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,

I'm not sure how much that harms but double-checked locking
(releasing) is simple enough for reducing possible congestion here, I
think. In short, + 1 for that.

> if (!SHMQueueIsDetached(&(MyProc->syncRepLinks)))
> {
>     LWLockAcquire(SyncRepLock, LW_EXCLUSIVE);
>     if (!SHMQueueIsDetached(&(MyProc->syncRepLinks)))
>         SHMQueueDelete(&(MyProc->syncRepLinks));
>     LWLockRelease(SyncRepLock);
> }

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



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

Предыдущее
От: Ibrar Ahmed
Дата:
Сообщение: Proposal: Global Index
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: [HACKERS] Block level parallel vacuum