Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A50DA1337B88 for ; Sat, 1 Jan 2011 13:29:36 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 84176-01 for ; Sat, 1 Jan 2011 17:29:29 +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 EE6031337B98 for ; Sat, 1 Jan 2011 13:29:28 -0400 (AST) 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 p01HTOcb032326; Sat, 1 Jan 2011 17:29:24 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 p01HTLin089009; Sat, 1 Jan 2011 17:29:22 GMT Subject: Re: Sync Rep Design From: Simon Riggs To: Stefan Kaltenbrunner Cc: Robert Haas , Jeff Janes , pgsql-hackers@postgresql.org In-Reply-To: <4D1F60B4.1060408@kaltenbrunner.cc> References: <1293729972.1892.23804.camel@ebony> <4D1CC47E.7050207@kaltenbrunner.cc> <1293735853.1892.24886.camel@ebony> <4D1CEEAF.8050209@kaltenbrunner.cc> <1293744235.1892.26478.camel@ebony> <4D1D93F1.80602@kaltenbrunner.cc> <1293791171.1892.36233.camel@ebony> <4D1F3437.10503@kaltenbrunner.cc> <4D1F4453.50903@kaltenbrunner.cc> <1293900957.1892.60412.camel@ebony> <4D1F60B4.1060408@kaltenbrunner.cc> Content-Type: text/plain; charset="UTF-8" Date: Sat, 01 Jan 2011 17:29:20 +0000 Message-ID: <1293902960.1892.61053.camel@ebony> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Server-Quench: ac0777a1-15cc-11e0-80b9-0022640b883e X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksachtFaARbZ1hf HGQLWlVEUVp7W2p/ aQgfZQRDZ1RPWwN0 U09WR1pVCwUmQRwA fnpiC0dyfwxGeHc+ ZERjWnQVDRd6ckF6 E09JFGhVNnphaTUf TUhYJQpJcANIfBlB agJ3XHBYLwdSbGoL PyYYHB0LBgAXEzVT SUk3IEpabUsQHzE6 L9Oe 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.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201101/23 X-Sequence-Number: 177860 On Sat, 2011-01-01 at 18:13 +0100, Stefan Kaltenbrunner wrote: > On 01/01/2011 05:55 PM, Simon Riggs wrote: > > > > It appears to me there has been substantial confusion over alternatives, > > because of a misunderstanding about how synchronisation works. Requiring > > confirmation that standbys are in sync is *not* the same thing as them > > actually being in sync. Every single proposal made by anybody here on > > hackers that supports multiple standby servers suffers from the same > > issue: when the primary crashes you need to work out which standby > > server is ahead. > > aaah that was exactly what I was after - so the problem is that when you > have a sync standby it will technically always be "in front" of the > master (because it needs to fsync/apply/whatever before the master). > In the end the question boils down to what is "the bigger problem" in > the case of a lost master: > a) a transaction that was confirmed on the master but might not be on > any of the surviving sync standbys (or you will never know if it is) - > this is how I understand the proposal so far No that cannot happen, the current situation is that we will fsync WAL on the master, then fsync WAL on the standby, then reply to the master. The standby is never ahead of the master, at any point. > b) a transaction that was not yet confirmed on the master but might have > been applied on the surving standby before the desaster - this is what I > understand "confirm from all sync standbys" could result in. Yes, that is described in the docs changes I published. (a) was discussed, but ruled out, since it would require any crash/immed shutdown of the master to become a failover, or have some kind of weird back channel to give the missing data back. There hasn't been any difference of opinion in this area, that I am aware of. All proposals have offered (b). -- Simon Riggs http://www.2ndQuadrant.com/books/ PostgreSQL Development, 24x7 Support, Training and Services