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

From Victor Wagner
Subject Re: Proposal: Implement failover on libpq connect level.
Date
Msg-id 20150819173448.GA4767@wagner.pp.ru
Whole thread Raw
In response to Re: Proposal: Implement failover on libpq connect level.  (Tatsuo Ishii <ishii@postgresql.org>)
Responses Re: Proposal: Implement failover on libpq connect level.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2015.08.20 at 00:17:35 +0900, Tatsuo Ishii wrote:

> > But once connection is established, each client works with one
> > server (at least until communication failure occurs and it would call
> > PQreset. In this case it has to reprepare statements anyway).
> 
> One downside of this is, if one of the standby servers is not
> responding, every time clients will be blocked by the server before
> giving up the connection trial. This could last for hours (for

This shouldn't happen. My proposal was to connect all servers
simultaneously, and then use that connection which would be established
first closing other ones

Even if we wouldn't do so (to properly randomize server load or to be
compatible with jdbc), there is connection_timeout parameter, so 
client wouldn't seat and just wait for hours while system TCP/IP stack
trying to connect nonexistent server.


> example, the network cable is plugged out). I think round robin DNS is
> better because the DNS server will drop the entry corresponding broken

DNS server wouldn't drop anything unless explicitely told so (by
administrator or by some watchdog software which is able to talk
nsupdate protocol). 

And not everyone database owner has control on his own domain.

Moreover, DNS is distributed system with agressive caching. If our
system is not local, DNS records for non-existing server would be cached
by DNS servers of client's internet provider. 




pgsql-hackers by date:

Previous
From: Qingqing Zhou
Date:
Subject: Re: Our trial to TPC-DS but optimizer made unreasonable plan
Next
From: jacques klein
Date:
Subject: Re: how to write/setup a C trigger function in a background worker