pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <amit.kapila16@gmail.com>
To: Victor Wagner <vitus@wagner.pp.ru>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Proposal: Implement failover on libpq connect level.
Date: Thu, 20 Aug 2015 08:36:31 +0530
Message-ID: <CAA4eK1LvugdRvXbEw_o7OSddVBRH8LD7s8qrwO3Z3gUfcpuG0Q@mail.gmail.com> (raw)
In-Reply-To: <20150819075304.GF31302@wagner.pp.ru>
References: <20150818041850.GA5092@wagner.pp.ru>
	<CAA4eK1LY9Yz_3wUYtj-3+VaOZA6nsKKuroGCJmCmfQVCFvcQBA@mail.gmail.com>
	<20150819070522.GB31302@wagner.pp.ru>
	<CAA4eK1K1jxHLL6iEep3TQcb+HAR6kv9pU1oZ2AA-mpJs0FoOuQ@mail.gmail.com>
	<20150819075304.GF31302@wagner.pp.ru>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On Wed, Aug 19, 2015 at 1:23 PM, Victor Wagner <vitus@wagner.pp.ru> wrote:
>
> On 2015.08.19 at 12:55:15 +0530, Amit Kapila wrote:
>
> > > I think that failover procedure should begin before first connection
is
> > > ever established.
> > >
> >
> > As far as I understand, failover gets initiated once the master server
goes
> > down or is not accessible due to some reason, so for such cases if you
> > have the connection to both the servers then it might not work.
>
> Master server might go down when client is not started yet.
> And when client starts up, it has to find out which server to connect
> now.
>

Always try with the first server specified in connection string and if that
is not available try with second and so on.  I think for the case of
failover,
the design shouldn't be much complicated and it is a standard thing provided
by most of the client-side drivers in other databases.  Considering what
currently PostgreSQL offers in terms of high-availability functionality, for
load-balancing, we need to be careful of many more things like redirecting
read-queries to standby's, write statements should be executed via
connection
to master.


With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

view thread (63+ messages)  latest in thread

Message-ID: <CAA4eK1LvugdRvXbEw_o7OSddVBRH8LD7s8qrwO3Z3gUfcpuG0Q@mail.gmail.com>
Permalink:  ../CAA4eK1LvugdRvXbEw_o7OSddVBRH8LD7s8qrwO3Z3gUfcpuG0Q@mail.gmail.com/
Also on:    postgresql.org/message-id/CAA4eK1LvugdRvXbEw_o7OSddVBRH8LD7s8qrwO3Z3gUfcpuG0Q@mail.gmail.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: amit.kapila16@gmail.com, vitus@wagner.pp.ru, pgsql-hackers@postgresql.org
  Subject: Re: Proposal: Implement failover on libpq connect level.
  In-Reply-To: <CAA4eK1LvugdRvXbEw_o7OSddVBRH8LD7s8qrwO3Z3gUfcpuG0Q@mail.gmail.com>
  References: <20150818041850.GA5092@wagner.pp.ru> <CAA4eK1LY9Yz_3wUYtj-3+VaOZA6nsKKuroGCJmCmfQVCFvcQBA@mail.gmail.com> <20150819070522.GB31302@wagner.pp.ru> <CAA4eK1K1jxHLL6iEep3TQcb+HAR6kv9pU1oZ2AA-mpJs0FoOuQ@mail.gmail.com> <20150819075304.GF31302@wagner.pp.ru> <CAA4eK1LvugdRvXbEw_o7OSddVBRH8LD7s8qrwO3Z3gUfcpuG0Q@mail.gmail.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