pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Sync Rep for 2011CF1
Date: Fri, 21 Jan 2011 17:33:53 +0200
Message-ID: <4D39A761.1020105@enterprisedb.com> (raw)
In-Reply-To: <1295616270.1803.10799.camel@ebony>
References: <1295127631.3282.100.camel@ebony>
	<4D397FE4.2020709@enterprisedb.com>
	<1295616270.1803.10799.camel@ebony>

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



view thread (89+ messages)  latest in thread

Message-ID: <4D39A761.1020105@enterprisedb.com>
Permalink:  ../4D39A761.1020105@enterprisedb.com/
Also on:    postgresql.org/message-id/4D39A761.1020105@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: heikki.linnakangas@enterprisedb.com, simon@2ndQuadrant.com
  Subject: Re: Sync Rep for 2011CF1
  In-Reply-To: <4D39A761.1020105@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox