Re: Problem with synchronous replication - Mailing list pgsql-hackers

From lingce.ldm
Subject Re: Problem with synchronous replication
Date
Msg-id 806F744F-F568-4B5F-B8F3-13077BA23721@alibaba-inc.com
Whole thread Raw
In response to Re: Problem with synchronous replication  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Oct 31, 2019, at 10:11, Michael Paquier <michael@paquier.xyz> wrote:
>
> On Wed, Oct 30, 2019 at 05:43:04PM +0900, Kyotaro Horiguchi wrote:
>> 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.
>
> FWIW, I could not measure any actual difference with pgbench -C, up to
> 500 sessions and an empty input file (just have one meta-command) and
> -c 20.
>
> I have added some comments in SyncRepCleanupAtProcExit(), and adjusted
> the patch with the suggestion from Fujii-san.  Any comments?

Thanks for the patch. Looks good to me +1.

Regards,

—
Dongming Liu


Attachment

pgsql-hackers by date:

Previous
From: Euler Taveira
Date:
Subject: Re: abs function for interval
Next
From: Tatsuro Yamada
Date:
Subject: Re: progress report for ANALYZE