Skip site navigation (1) Skip section navigation (2)

Re: Patch: Implement failover on libpq connect level.

From: Victor Wagner <vitus(at)wagner(dot)pp(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch: Implement failover on libpq connect level.
Date: 2016-09-30 08:44:51
Message-ID: 20160930114451.68e0fade@fafnir.local.vm (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-jdbc
On Thu, 29 Sep 2016 23:45:52 +0530
Mithun Cy <mithun(dot)cy(at)enterprisedb(dot)com> wrote:

> This patch do not apply on latest code. it fails as follows

It's strange. I have no problems applying it to commit

Ok, some trailing whitespace and mixing of tabs and spaces
which git apply doesn't like really present in the patch.

I'm attached hear version with these issues resolved.

> I am slightly confused. As per this target_server_type=master means
> user is expecting failover. What if user pass target_server_type=any
> and request sequential connection isn't this also a case for
> failover?.  I think by default it should be "any" for any number of
> hosts. And parameter "sequential and random will decide whether we
> want just failover or with load-balance.

I don't agree with this. In the first versions of the patch it refuses 
connect to readonly server even if it is only one, because I think that
read-write connection is what user typically expect.

When user tries to connect to cluster (specifying many hosts in the
connect string), it can be by default assumed that he wants master. 

But backward compatibility is more
important thing, so I now assume, that user tries to connect just one
node, and this node is read only, user knows what he is doing.


Attachment: libpq-failover-9.patch
Description: text/x-patch (46.0 KB)

In response to


pgsql-hackers by date

Next:From: Michael PaquierDate: 2016-09-30 09:13:56
Subject: Re: Fix checkpoint skip logic on idle systems by tracking LSN progress
Previous:From: Amit KapilaDate: 2016-09-30 08:07:15
Subject: Re: Hash Indexes

pgsql-jdbc by date

Next:From: Michael PaquierDate: 2016-10-03 00:50:48
Subject: Re: Patch: Implement failover on libpq connect level.
Previous:From: Prasad VarakurDate: 2016-09-30 06:10:44
Subject: Re: reg license implications in implementing/using the JDBC spec

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group