Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 417D01337B5D for ; Fri, 31 Dec 2010 15:16:21 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 74265-03; Fri, 31 Dec 2010 19:16:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail148113.authsmtp.com (outmail148113.authsmtp.com [62.13.148.113]) by mail.postgresql.org (Postfix) with ESMTP id 161AF1337B92; Fri, 31 Dec 2010 15:16:12 -0400 (AST) Received: from mail-c193.authsmtp.com (mail-c193.authsmtp.com [62.13.128.118]) by punt10.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id oBVJG339011165; Fri, 31 Dec 2010 19:16:03 GMT Received: from [192.168.0.2] ([81.5.146.37]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id oBVJG0FC084562; Fri, 31 Dec 2010 19:16:00 GMT Subject: Re: Sync Rep Design From: Simon Riggs To: Heikki Linnakangas Cc: greg@2ndQuadrant.com, Josh Berkus , Hannu Krosing , Robert Haas , Stefan Kaltenbrunner , pgsql-hackers@postgresql.org In-Reply-To: <4D1DCF5A.7070808@enterprisedb.com> References: <1293729972.1892.23804.camel@ebony> <4D1CC47E.7050207@kaltenbrunner.cc> <1293735853.1892.24886.camel@ebony> <4D1D8B2F.5070001@2ndquadrant.com> <4D1DAB14.5000800@enterprisedb.com> <1293796137.1892.37313.camel@ebony> <4D1DCF5A.7070808@enterprisedb.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 31 Dec 2010 19:15:59 +0000 Message-ID: <1293822959.1892.43164.camel@ebony> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Server-Quench: 67865f12-1512-11e0-97bb-002264978518 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksacRtFawRbaVxS HGQLWlREUVR7WGV/ awsfZQRDZ1RPWwN0 U09WR1pVCwUmXm5n fGkeJGpyfwFDfnw+ ZkRmVnAVWkNyc0Mr Q0xJFGgHZ3phaTUf TUlfJVFJcANIfBlB Y1d3UXIFLwdSbGoL PyYYHB0LBgAXEzVT SUk3IEpabUsQHzE6 L1Oa X-Authentic-SMTP: 61633235383639.1014:706 X-AuthFastPath: 0 (Was 255) X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201012/2568 X-Sequence-Number: 177830 On Fri, 2010-12-31 at 14:40 +0200, Heikki Linnakangas wrote: > On 31.12.2010 13:48, Simon Riggs wrote: > > > > I see significant real-world issues with configuring replication using > > multiple named servers, as described in the link above: > > All of these points only apply to specifying *multiple* named servers in > the synchronous_standbys='...' list. Unfortunately, some of the points apply to using named servers ever, even if there is only one. > That's certainly a more complicated > scenario, and the configuration is more complicated as a result. > With your proposal, it's not possible in the first place. > > Multiple synchronous standbys probably isn't needed by most people, so > I'm fine with leaving that out for now, keeping the design the same > otherwise. I included it in the proposal because it easily falls out of > the design. So, if you're worried about the complexities of multiple > synchronous standbys, let's keep the UI exactly the same as what I > described in the link above, but only allow one name in the > synchronous_standbys setting, instead of a list. The best usage recommendation is still to have 2+ standbys, *any* of which can be used to provide sync rep. That is the best performance, best availability and easiest to configure that I know of. That best usage is not achievable with uniquely named servers; using non-unique names defeats the point of having names in the first place. I accept that the "best usage" is a general case and there may be circumstances that make the difficulties of named servers worth the trouble. So replicating to multiple synchronous standbys is definitely needed in this release. *Confirming* replication to multiple named sync standbys is the thing we don't need in this release. > > I suppose we might regard the feature set I am proposing as being the > > same as making synchronous_standbys a USERSET parameter, and allowing > > just two options: > > "none" - allowing the user to specify async if they wish it > > "*" - allowing people to specify that syncing to *any* standby is > > acceptable > > > > We can blend the two approaches together, if we wish, by having two > > parameters (plus server naming) > > synchronous_replication = on | off (USERSET) > > synchronous_standbys = '...' > > If synchronous_standbys is not set and synchronous_replication = on then > > we sync to any standby. If synchronous_replication = off then we use > > async replication, whatever synchronous_standbys is set to. > > If synchronous_standbys is set, then we use sync rep to all listed > > servers. > > Sounds good. > I still don't like the synchronous_standbys='' and > synchronous_replication=on combination, though. > IMHO that still amounts > to letting the standby control the behavior on master, and it makes it > impossible to temporarily add an asynchronous standby to the mix. I > could live with it, you wouldn't be forced to use it that way after all, > but I would still prefer to throw an error on that combination. Or at > least document the pitfalls and recommend always naming the standbys. We need a parameter set that makes the best practice easy/easiest to specify, and yet more complicated configurations possible. So I'm happy to add "synchronous_standbys" parameter, as long as it is possible to specify "any" (for which I would use "*"), which would be the default. Initially that would be restricted to just one name. Will pass the server name as an option after IDENTIFY SYSTEM . Anyway, lets continue the discussion next year. -- Simon Riggs http://www.2ndQuadrant.com/books/ PostgreSQL Development, 24x7 Support, Training and Services