From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Albe Laurenz <laurenz.albe@wien.gv.at>
Cc: Victor Wagner <vitus@wagner.pp.ru>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Proposal: Implement failover on libpq connect level.
Date: Tue, 1 Sep 2015 14:50:10 -0300
Message-ID: <20150901175010.GP2912@alvherre.pgsql> (raw)
In-Reply-To: <CA+Tgmoa++eXswwzPkhRjF-qi4vex74YYGk8BRZW=pB05ic_dvg@mail.gmail.com>
References: <20150818041850.GA5092@wagner.pp.ru>
<A737B7A37273E048B164557ADEF4A58B50F92F7C@ntex2010i.host.magwien.gv.at>
<20150819065146.GA31302@wagner.pp.ru>
<A737B7A37273E048B164557ADEF4A58B50F9386F@ntex2010i.host.magwien.gv.at>
<20150819074417.GE31302@wagner.pp.ru>
<A737B7A37273E048B164557ADEF4A58B50F93B53@ntex2010i.host.magwien.gv.at>
<30615.1439991692@sss.pgh.pa.us>
<CA+Tgmoa++eXswwzPkhRjF-qi4vex74YYGk8BRZW=pB05ic_dvg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Robert Haas wrote:
> On Wed, Aug 19, 2015 at 9:41 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > That sort-of ties into what seems to me the main objection to this
> > proposal, namely that there is already a way to do this sort of thing:
> > DNS-based load balancing. All the clients think they connect to
> > db.mycompany.com, but which server they actually get is determined by
> > what IP address the DNS server tells them to use.
>
> But that kinda sucks. I mean, suppose I have three servers, A, B, and
> C. I point db.mycompany.com to A, which is the master; then A dies.
> Under your proposal, whatever script I use to control failover now has
> to change the DNS records to repoint db.mycompany.com to B, my new,
> and newly-promoted, new master. It's quite possible that some
> machines on the network, or some processes, will have the old IP
> address cached, and it may be several minutes before those caches time
> out. In the meantime, I'm down: even if I bounce the application
> servers, they may just try to reconnect to A.
The solution to this part seems to be to lower the TTL, which seems
easy enough.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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: alvherre@2ndquadrant.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, laurenz.albe@wien.gv.at, vitus@wagner.pp.ru, pgsql-hackers@postgresql.org
Subject: Re: Proposal: Implement failover on libpq connect level.
In-Reply-To: <20150901175010.GP2912@alvherre.pgsql>
References: <20150818041850.GA5092@wagner.pp.ru> <A737B7A37273E048B164557ADEF4A58B50F92F7C@ntex2010i.host.magwien.gv.at> <20150819065146.GA31302@wagner.pp.ru> <A737B7A37273E048B164557ADEF4A58B50F9386F@ntex2010i.host.magwien.gv.at> <20150819074417.GE31302@wagner.pp.ru> <A737B7A37273E048B164557ADEF4A58B50F93B53@ntex2010i.host.magwien.gv.at> <30615.1439991692@sss.pgh.pa.us> <CA+Tgmoa++eXswwzPkhRjF-qi4vex74YYGk8BRZW=pB05ic_dvg@mail.gmail.com> <20150901175010.GP2912@alvherre.pgsql>
* 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