Re: Quorum commit for multiple synchronous replication.
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Fujii Masao <masao.fujii@gmail.com>, Petr Jelinek <petr@2ndquadrant.com>, Vik Fearing <vik@2ndquadrant.fr>, Simon Riggs <simon@2ndquadrant.com>, Josh Berkus <josh@agliodbs.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2016-12-08T09:32:47Z
Lists: pgsql-hackers
Attachments
- 000_quorum_commit_v9.patch (text/x-diff) patch v9
On Thu, Dec 8, 2016 at 4:39 PM, Michael Paquier <michael.paquier@gmail.com> wrote: > On Thu, Dec 8, 2016 at 9:07 AM, Robert Haas <robertmhaas@gmail.com> wrote: >> You could do that, but first I would code up the simplest, cleanest >> algorithm you can think of and see if it even shows up in a 'perf' >> profile. Microbenchmarking is probably overkill here unless a problem >> is visible on macrobenchmarks. > > This is what I would go for! The current code is doing a simple thing: > select the Nth element using qsort() after scanning each WAL sender's > values. And I think that Sawada-san got it right. Even running on my > laptop a pgbench run with 10 sync standbys using a data set that fits > into memory, SyncRepGetOldestSyncRecPtr gets at most 0.04% of overhead > using perf top on a non-assert, non-debug build. Hash tables and > allocations get a far larger share. Using the patch, > SyncRepGetSyncRecPtr is at the same level with a quorum set of 10 > nodes. Let's kick the ball for now. An extra patch could make things > better later on if that's worth it. Yeah, since the both K and N could be not large these algorithm takes almost the same time. And current patch does simple thing. When we need over 100 or 1000 replication node the optimization could be required. Attached latest v9 patch. Regards, -- Masahiko Sawada NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Set the priorities of all quorum synchronous standbys to 1.
- 346199dcab4c 10.0 landed
-
Improve documentation and comment for quorum-based sync replication.
- a790ed9f69ef 10.0 landed