Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZS7Hz-0007YT-Gt for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Aug 2015 17:36:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZS7Hz-0005rQ-2m for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Aug 2015 17:36:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZS7Gh-0004O5-I1 for pgsql-hackers@postgresql.org; Wed, 19 Aug 2015 17:35:19 +0000 Received: from wagner.pp.ru ([178.63.209.18] helo=mx.wagner.pp.ru) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZS7Ge-00063e-Nk for pgsql-hackers@postgresql.org; Wed, 19 Aug 2015 17:35:18 +0000 Received: from mail.wagner.pp.ru (unknown [192.168.217.131]) by mx.wagner.pp.ru (Postfix) with ESMTP id 0DAE814B4471 for ; Wed, 19 Aug 2015 20:34:58 +0300 (MSK) Received: from wagner.pp.ru (wifi [192.168.217.63]) by mail.wagner.pp.ru (Postfix) with ESMTPSA id 22E20211F1 for ; Wed, 19 Aug 2015 20:34:50 +0300 (MSK) Date: Wed, 19 Aug 2015 20:34:48 +0300 From: Victor Wagner To: pgsql-hackers@postgresql.org Subject: Re: Proposal: Implement failover on libpq connect level. Message-ID: <20150819173448.GA4767@wagner.pp.ru> Mail-Followup-To: pgsql-hackers@postgresql.org References: <20150818041850.GA5092@wagner.pp.ru> <20150819.124245.1322750734243127189.t-ishii@sraoss.co.jp> <20150819071009.GC31302@wagner.pp.ru> <20150820.001735.1312191060652873768.t-ishii@sraoss.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150820.001735.1312191060652873768.t-ishii@sraoss.co.jp> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.5 (--) 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 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. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers