Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 5332C1337B83 for ; Fri, 18 Mar 2011 18:26:23 -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 32354-09 for ; Fri, 18 Mar 2011 21:26:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail149120.authsmtp.net (outmail149120.authsmtp.net [62.13.149.120]) by mail.postgresql.org (Postfix) with ESMTP id 7985B133655C for ; Fri, 18 Mar 2011 18:26:15 -0300 (ADT) Received: from mail-c194.authsmtp.com (mail-c194.authsmtp.com [62.13.128.121]) by punt6.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id p2ILQ2SN023504; Fri, 18 Mar 2011 21:26:02 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 p2ILQ0YU059449; Fri, 18 Mar 2011 21:26:01 GMT Subject: Re: Re: [COMMITTERS] pgsql: Efficient transaction-controlled synchronous replication. From: Simon Riggs To: Aidan Van Dyk Cc: Markus Wanner , Heikki Linnakangas , Kevin Grittner , MARK CALLAGHAN , Alvaro Herrera , Andrew Dunstan , pgsql-hackers In-Reply-To: References: <4D741441.2090704@dunslane.net> <1299454125.1696.6138.camel@ebony> <4D74896C.5030402@enterprisedb.com> <4D74DDFA.70800@dunslane.net> <4D74E584.7080409@enterprisedb.com> <4D74E9FA.7070202@dunslane.net> <4D74F3AE.9000802@dunslane.net> <4D74FDEC.5040406@enterprisedb.com> <4D74FF15.1070804@dunslane.net> <1299513979-sup-1987@alvh.no-ip.org> <4D832571.5030808@bluegap.ch> <1300457958.18619.13780.camel@ebony> <4D832B4D020000250003BA98@gw.wicourts.gov> <4D837EA2.2070205@enterprisedb.com> <1300465171.18619.15193.camel@ebony> <4D83B02A.5090105@bluegap.ch> <1300476590.18619.18115.camel@ebony> <4D83B54C.2030708@bluegap.ch> Content-Type: text/plain; charset="UTF-8" Date: Fri, 18 Mar 2011 21:26:00 +0000 Message-ID: <1300483560.18619.19276.camel@ebony> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Server-Quench: 52bb2f38-51a6-11e0-80b9-0022640b883e X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksafhtFaQ1bYFhD HGQLWlVEUlx7W2V/ awsfZQRDZ1RPWwN0 U09WR1pVCwUmQR54 en8eO3xycgxCfHc+ Z0FrXnQVWUYoJ0Qr QUZJEGxXY3phaTUf TUhYJQpJcANIfBlB agJ3XHBYLwdSbGoL PyYYHB0LBgAXEikH CjImCnc3YHo3MwQH clgaEi42GR9Nais9 LhcnJ1gAfg4NKEw0 KlIqRVMfNVoZDQtC BUZJBCJVb0IQQSEr FwRcWlMFWCdQWSNd CRQ0IxhORFQA X-Authentic-SMTP: 61633235383639.1015: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/1173 X-Sequence-Number: 184423 On Fri, 2011-03-18 at 17:08 -0400, Aidan Van Dyk wrote: > On Fri, Mar 18, 2011 at 3:41 PM, Markus Wanner wrote: > > On 03/18/2011 08:29 PM, Simon Riggs wrote: > >> We could do that easily enough, actually, if we wished. > >> > >> Do we wish? > > > > I personally don't see any problem letting a standby show a snapshot > > before the master. I'd consider it unneeded network traffic. But then > > again, I'm completely biased. > > In fact, we *need* to have standbys show a snapshot before the master. > > By the time the master acks the commit to the client, the snapshot > must be visible to all client connected to both the master and the > syncronous slave. > > Even with just a single server postgresql cluster, other > clients(backends) can see the commit before the commiting client > receives the ACK. Just that on a single server, the time period for > that is small. > > Sync rep increases that time period by the length of time from when > the slave reaches the commit point in the WAL stream to when it's ack > of that point get's back to the wal sender. Ideally, that ACK time is > small. > > Adding another round trip in there just for a "go almost to $COMIT, > ok, now go to $COMMIT" type of WAL/ack is going to be pessimal for > performance, and still not improve the *guarentees* it can make. > > It can only slightly reduce, but not eliminated that window where them > master has WAL that the slave doesn't, and without a complete > elimination (where you just switch the problem to be the slave has the > data that the master doesn't), you haven't changed any of the > guarantees sync rep can make (or not). Well explained observation. Agreed. -- Simon Riggs http://www.2ndQuadrant.com/books/ PostgreSQL Development, 24x7 Support, Training and Services