Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZWphV-0001dc-MO for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Sep 2015 17:50:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZWphV-000360-1r for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Sep 2015 17:50:29 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZWphT-00034M-7A for pgsql-hackers@postgresql.org; Tue, 01 Sep 2015 17:50:27 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZWphL-00007O-Cy for pgsql-hackers@postgresql.org; Tue, 01 Sep 2015 17:50:25 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [200.104.169.63]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 8945F401019; Tue, 1 Sep 2015 10:50:13 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 53EC4E7A; Tue, 1 Sep 2015 14:50:10 -0300 (CLT) Date: Tue, 1 Sep 2015 14:50:10 -0300 From: Alvaro Herrera To: Robert Haas Cc: Tom Lane , Albe Laurenz , Victor Wagner , "pgsql-hackers@postgresql.org" Subject: Re: Proposal: Implement failover on libpq connect level. Message-ID: <20150901175010.GP2912@alvherre.pgsql> References: <20150818041850.GA5092@wagner.pp.ru> <20150819065146.GA31302@wagner.pp.ru> <20150819074417.GE31302@wagner.pp.ru> <30615.1439991692@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas wrote: > On Wed, Aug 19, 2015 at 9:41 AM, Tom Lane 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