Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 929B91337999 for ; Fri, 18 Mar 2011 16:18:08 -0300 (ADT) 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 14498-02 for ; Fri, 18 Mar 2011 19:17:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from shaykin.bluegap.ch (shaykin.bluegap.ch [78.46.81.73]) by mail.postgresql.org (Postfix) with ESMTP id E5684133655C for ; Fri, 18 Mar 2011 16:17:57 -0300 (ADT) Received: from [IPv6:2001:1620:f70:16:216:e6ff:fed5:fc9] ([2001:1620:f70:16:216:e6ff:fed5:fc9]) (AUTH: LOGIN markus@bluegap.ch, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by shaykin.bluegap.ch with esmtp; Fri, 18 Mar 2011 20:17:57 +0100 id 0000000002A08009.000000004D83AFE5.000013B4 Message-ID: <4D83AFE4.8020207@bluegap.ch> Date: Fri, 18 Mar 2011 20:17:56 +0100 From: Markus Wanner User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101226 Icedove/3.0.11 MIME-Version: 1.0 To: Greg Stark CC: Robert Haas , Simon Riggs , Heikki Linnakangas , Kevin Grittner , MARK CALLAGHAN , Alvaro Herrera , Andrew Dunstan , Aidan Van Dyk , pgsql-hackers Subject: Re: [COMMITTERS] pgsql: Efficient transaction-controlled synchronous replication. 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> In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.409 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FS_REPLICA=3.599, SARE_SPEC_REPLICA=0.72, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: ** X-Archive-Number: 201103/1162 X-Sequence-Number: 184412 On 03/18/2011 06:35 PM, Greg Stark wrote: > I think promising that the COMMIT doesn't return until the transaction > and all previous transactions are replicated is enough. We don't have > to promise that nobody else will see it either. Those same > transactions eventually have to commit as well No, they don't have to. They can ROLLBACK, get aborted, lose connection to the master, etc.. The issue here is that, given the MySQL scheme, these transactions see a snapshot that's not durable, because at that point in time, no standby guarantees to have stored the transaction to be committed, yet. So in case of a failover, you'd suddenly see a different snapshot (and lose changes of that transaction). > This is akin to the synchronous_commit=off case where other > transactions can see your data as soon as you commit even before the > xlog is fsynced. If you have synchronous_commit mode enabled then > you'll block until your xlog is fsynced and that will implicitly mean > the other transactions you saw were also fsynced. Somewhat, yes. And for exactly that reason, most users run with synchronous_commit enabled. They don't want to lose committed transactions. Regards Markus Wanner