Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 010831337B58 for ; Mon, 7 Mar 2011 10:03:02 -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 17114-09 for ; Mon, 7 Mar 2011 14:02:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og117.obsmtp.com (exprod7og117.obsmtp.com [64.18.2.6]) by mail.postgresql.org (Postfix) with ESMTP id 1BE241337B4E for ; Mon, 7 Mar 2011 10:02:49 -0400 (AST) Received: from source ([209.85.215.47]) (using TLSv1) by exprod7ob117.postini.com ([64.18.6.12]) with SMTP ID DSNKTXTliE0kAu4j4undYLrpa0kbwSQdFbZv@postini.com; Mon, 07 Mar 2011 06:02:51 PST Received: by ewy8 with SMTP id 8so1208563ewy.6 for ; Mon, 07 Mar 2011 06:02:47 -0800 (PST) Received: by 10.213.13.207 with SMTP id d15mr1146085eba.48.1299506566895; Mon, 07 Mar 2011 06:02:46 -0800 (PST) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id t50sm2053506eeh.18.2011.03.07.06.02.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Mar 2011 06:02:45 -0800 (PST) Message-ID: <4D74E584.7080409@enterprisedb.com> Date: Mon, 07 Mar 2011 16:02:44 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.16) Gecko/20101226 Icedove/3.0.11 MIME-Version: 1.0 To: Andrew Dunstan CC: Simon Riggs , pgsql-hackers@postgresql.org Subject: Re: 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> In-Reply-To: <4D74DDFA.70800@dunslane.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.419 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FS_REPLICA=3.599, SARE_SPEC_REPLICA=0.72 X-Spam-Level: ** X-Archive-Number: 201103/465 X-Sequence-Number: 183715 On 07.03.2011 15:30, Andrew Dunstan wrote: > Previously, Simon said: > >> Truly "synchronous" requires two-phase commit, which this never was. > > So I too am confused about how it's now become "truly synchronous". Are > we saying this give the same or better guarantees than a 2PC setup? The guarantee we have now with synchronous_replication=on is that when the server acknowledges a commit to the client (ie. when COMMIT command returns), the transaction is safely flushed to disk on the master and at least one synchronous standby server. What you don't get is a guarantee on what happens to transactions that were not acknowledged to the client. For example, if you pull the power plug, the transaction that was just being committed might be committed on the master, but not yet on the standby. For me, that's enough to call it "synchronous replication". It provides a useful guarantee to the client. But you could argue for an even stricter definition, requiring atomicity so that if a transaction is not successfully replicated for any reason, including crash, it is rolled back in the master too. That would require 2PC. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com