Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id ABBA21337B2F for ; Fri, 21 Jan 2011 11:38:29 -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 10553-04 for ; Fri, 21 Jan 2011 15:38:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og127.obsmtp.com (exprod7og127.obsmtp.com [64.18.2.210]) by mail.postgresql.org (Postfix) with ESMTP id 7BD371337B5C for ; Fri, 21 Jan 2011 11:38:21 -0400 (AST) Received: from source ([209.85.215.49]) (using TLSv1) by exprod7ob127.postini.com ([64.18.6.12]) with SMTP ID DSNKTTmobQCppIEO3IIcyRnpjw6aZ0z9MuUk@postini.com; Fri, 21 Jan 2011 07:38:22 PST Received: by mail-ew0-f49.google.com with SMTP id 20so855433ewy.36 for ; Fri, 21 Jan 2011 07:38:21 -0800 (PST) Received: by 10.14.0.133 with SMTP id 5mr963876eeb.10.1295624036981; Fri, 21 Jan 2011 07:33:56 -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 t12sm1221207eeh.3.2011.01.21.07.33.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 21 Jan 2011 07:33:56 -0800 (PST) Message-ID: <4D39A761.1020105@enterprisedb.com> Date: Fri, 21 Jan 2011 17:33:53 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10 MIME-Version: 1.0 To: Simon Riggs CC: pgsql-hackers@postgresql.org Subject: Re: Sync Rep for 2011CF1 References: <1295127631.3282.100.camel@ebony> <4D397FE4.2020709@enterprisedb.com> <1295616270.1803.10799.camel@ebony> In-Reply-To: <1295616270.1803.10799.camel@ebony> 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=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201101/2103 X-Sequence-Number: 179940 On 21.01.2011 15:24, Simon Riggs wrote: > On Fri, 2011-01-21 at 14:45 +0200, Heikki Linnakangas wrote: >> * it seems like overkill to not let clients to even connect when >> allow_standalone_primary=off and no synchronous standbys are available. >> What if you just want to run a read-only query? > > That's what Aidan requested, I agreed and so its there. You're using > sync rep because of writes, so you have a read-write app. If you allow > connections then half of the app will work, half will not. Half-working > isn't very useful, as Aidan eloquently explained. If your app is all > read-only you wouldn't be using sync rep anyway. That's the argument, > but I've not got especially strong feelings it has to be this way. It's also possible that most of your transactions in fact do "set synchronous_replication=off", and only a few actually do synchronous replication. It would be pretty bad to not allow connections in that case. And what if you want to connect to the server to diagnose the issue? Oh, you can't... Besides, we're not kicking out existing connections, are we? Seems inconsistent to let the old connections live. IMHO the only reasonable option is to allow connections as usual, and only fail (or block forever) at COMMIT. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com