Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id A5D321337B5D for ; Thu, 30 Dec 2010 16:39:19 -0400 (AST) 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 64439-04 for ; Thu, 30 Dec 2010 20:39:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail149084.authsmtp.net (outmail149084.authsmtp.net [62.13.149.84]) by mail.postgresql.org (Postfix) with ESMTP id 432291337B5B for ; Thu, 30 Dec 2010 16:39:12 -0400 (AST) Received: from mail-c187.authsmtp.com (mail-c187.authsmtp.com [62.13.128.33]) by punt8.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id oBUKd8f3068899; Thu, 30 Dec 2010 20:39:08 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 oBUKd6Zu066856; Thu, 30 Dec 2010 20:39:06 GMT Subject: Re: Sync Rep Design From: Simon Riggs To: Robert Treat Cc: Stefan Kaltenbrunner , pgsql-hackers@postgresql.org In-Reply-To: References: <1293729972.1892.23804.camel@ebony> <4D1CC47E.7050207@kaltenbrunner.cc> <1293735853.1892.24886.camel@ebony> Content-Type: text/plain; charset="UTF-8" Date: Thu, 30 Dec 2010 20:39:05 +0000 Message-ID: <1293741545.1892.25943.camel@ebony> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Server-Quench: d907b65e-1454-11e0-ab46-001185d377ca X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksadRtFawVbaVxS HGQLWlREUl17Wmp/ aw0fZQRDZ1RPWwN0 U09WR1pVCwUmXm5k fUoYOFxycQNOfXg+ YEJqWT4PVUR9J0B4 F1NVEWgCeGZhPWAC ARJccR5UcAJLdhoR aVd4ByJDAzANdhEY NiQQEgoKCH1kOSJe CjsANRo+TF0KEThU 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.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201012/2495 X-Sequence-Number: 177757 On Thu, 2010-12-30 at 15:07 -0500, Robert Treat wrote: > > We use a single parameter to enable synchronous replication, set in > > postgresql.conf on both primary and standby servers: > > > > synchronous_replication = off (default) | on > > > > On the primary, synchronous_replication can be set for particular > users > > or databases, or dynamically by applications programs. > > > > > This seems like a potential issue, where I start a server with this > off, and then I start turning it on for specific transactions; it > isn't exactly clear what happens, since there may or may not be a > running synchronous rep slave available. (I love the idea though) Not really an issue. Even if there was a standby there a moment ago, the standby can go away at any time. So we must cope gracefully with what happens if you do this. By default, the parameters specify that in the case you mention we will just use async replication (no wait!). Options exist to change that, since some people want to wait until the sysadmin adds a standby. -- Simon Riggs http://www.2ndQuadrant.com/books/ PostgreSQL Development, 24x7 Support, Training and Services