Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 452541337B8B for ; Fri, 18 Mar 2011 12:41:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 19209-01 for ; Fri, 18 Mar 2011 15:41:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail148154.authsmtp.co.uk (outmail148154.authsmtp.co.uk [62.13.148.154]) by mail.postgresql.org (Postfix) with ESMTP id 7643B1337B83 for ; Fri, 18 Mar 2011 12:41:26 -0300 (ADT) Received: from mail-c187.authsmtp.com (mail-c187.authsmtp.com [62.13.128.33]) by punt6.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id p2IFfMn8099259; Fri, 18 Mar 2011 15:41:22 GMT Received: from [192.168.0.3] ([81.5.146.37]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id p2IFfJ3F065091; Fri, 18 Mar 2011 15:41:19 GMT Subject: Re: [COMMITTERS] pgsql: Efficient transaction-controlled synchronous replication. From: Simon Riggs To: Robert Haas Cc: Greg Stark , Fujii Masao , PostgreSQL-development In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Fri, 18 Mar 2011 15:40:57 +0000 Message-ID: <1300462857.18619.14696.camel@ebony> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Server-Quench: 2b928e0f-5176-11e0-ab46-001185d377ca X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksachtFaQ1bYFhD HGQLWlVEUVh7XWJ/ aQofZQRDZ1RPWwN0 U09WR1pVCwUmQR54 cEhkUW9ycQBGcX8+ ZEVgXHgVXhZzd04o QhhJEGwBY3phaTUf TREKcwVJcANLfxdA PlN4UyBcLwdSbGoL NCgWGhENARhlExEd Wg4WNFZACWsFED83 Rh0EAX0zB0QDXCw4 Mx0hLBsXG0ANKEI2 NVYtOxoDIhkZChdZ GUZQG2dDKkEFRiEi EQJdWwh2 X-Authentic-SMTP: 61633235383639.1000: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.719 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FS_REPLICA=3.599, RCVD_IN_DNSWL_LOW=-0.7, SARE_SPEC_REPLICA=0.72 X-Spam-Level: * X-Archive-Number: 201103/1139 X-Sequence-Number: 184389 On Fri, 2011-03-18 at 11:07 -0400, Robert Haas wrote: > On Fri, Mar 18, 2011 at 10:55 AM, Greg Stark wrote: > > On Thu, Mar 17, 2011 at 5:46 PM, Robert Haas wrote: > >> What makes more sense to me after having thought about this more > >> carefully is to simply make a blanket rule that when > >> synchronous_replication=on, synchronous_commit has no effect. That is > >> easy to understand and document. > > > > For what it's worth "has no effect" doesn't make much sense to me. > > It's a boolean, either commits are going to block or they're not. > > > > What happened to the idea of a three-way switch? > > > > synchronous_commit = off > > synchronous_commit = disk > > synchronous_commit = replica > > > > With "on" being a synonym for "disk" for backwards compatibility. > > > > Then we could add more options later for more complex conditions like > > waiting for one server in each data centre or waiting for one of a > > certain set of servers ignoring the less reliable mirrors, etc. > > This is similar to what I suggested upthread, except that I suggested > on/local/off, with the default being on. That way if you set > synchronous_standby_names, you get synchronous replication without > changing another setting, but you can say local instead if for some > reason you want the middle behavior. If we're going to do it all with > one GUC, I think that way makes more sense. If you're running sync > rep, you might still have some transactions that you don't care about, > but that's what async commit is for. It's a funny kind of transaction > that we're OK with losing if we have a failover but we're not OK with > losing if we have a local crash from which we recover without failing > over. I much prefer a single switch, which is what I originally suggested. Changing the meaning of synchronous_commit seems a problem. durability = localmemory durability = localdisk (durability = remotereceive - has no meaning in current code) durability = remotedisk durability = remoteapply it also allows us to have in the future -- Simon Riggs http://www.2ndQuadrant.com/books/ PostgreSQL Development, 24x7 Support, Training and Services