Re: Problem with synchronous replication
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: masao.fujii@gmail.com, lingce.ldm@alibaba-inc.com, pgsql-hackers@postgresql.org
Date: 2019-10-31T02:11:03Z
Lists: pgsql-hackers
Attachments
- syncrep-lwlocks-v2.patch (text/x-diff) patch v2
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? -- Michael
Commits
-
Add some assertions in syncrep.c
- e174f699c476 13.0 landed
-
Fix race condition at backend exit when deleting element in syncrep queue
- f88f7206edbf 9.4.25 landed
- 0927d0c25c56 9.5.20 landed
- 52684bc7d957 9.6.16 landed
- b99bfc3c96f1 10.11 landed
- 61f23839257d 11.6 landed
- 7b8c2de64e66 12.1 landed
- 20345197ff48 13.0 landed
-
Fix typo in comment of syncrep.c
- f921ea624eb8 13.0 landed