Re: Patch: Implement failover on libpq connect level. - Mailing list pgsql-hackers

From Victor Wagner
Subject Re: Patch: Implement failover on libpq connect level.
Date
Msg-id 20151109124404.1af6ba0c@fafnir
Whole thread Raw
In response to Re: Patch: Implement failover on libpq connect level.  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: Patch: Implement failover on libpq connect level.  (Korry Douglas <korry.douglas@enterprisedb.com>)
List pgsql-hackers
On Mon, 9 Nov 2015 15:14:02 +0800
Craig Ringer <craig@2ndquadrant.com> wrote:


> 
> I'd rather not see convoluted and complex connstrings, per my prior
> post. The JDBC extended URL style seems good enough.

It is what my patch implements.
> IMO the biggest problem is that client-side failover is way more
> complex than "got -ECONNREFUSED, try next host". I think we're all
> focusing on not being able to twiddle arbitrary settings while
> ignoring the real problem with client failover, i.e. making it
> actually work in the real world.
> 
I've tried to deal with some of these problems. 

My patch have support for following things:

1. Check whether database instance is in the recovery/standby mode and
try to find another one if so.
2. Let cluster management software to have some time to promote one of
the standbys to master. I.e. there can be failover timeout specified to
allow retry after some time if no working master found.

Really there is room for some improvements in handling of connect
timeout (which became much more important thing when ability to try
next host appears). Now it is handled only by blocking-mode connect
functions, not by async state machine. But I decided to publish patch
without these improvements to get feedback from community.





pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: Foreign join pushdown vs EvalPlanQual
Next
From: Konstantin Knizhnik
Date:
Subject: Re: Transactions involving multiple postgres foreign servers