Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZYfcY-0007r3-71 for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Sep 2015 19:28:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZYfcX-0001p3-Cv for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Sep 2015 19:28:57 +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 1ZYfbE-0000HT-2H for pgsql-hackers@postgresql.org; Sun, 06 Sep 2015 19:27:36 +0000 Received: from wagner.pp.ru ([178.63.209.18] helo=mx.wagner.pp.ru) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZYfbB-0001Gr-DL for pgsql-hackers@postgresql.org; Sun, 06 Sep 2015 19:27:34 +0000 Received: from mail.wagner.pp.ru (unknown [192.168.217.131]) by mx.wagner.pp.ru (Postfix) with ESMTP id BAB1E486168 for ; Sun, 6 Sep 2015 22:27:13 +0300 (MSK) Received: from wagner.wagner.home (wifi [192.168.217.63]) by mail.wagner.pp.ru (Postfix) with ESMTPSA id BF6F2216B3 for ; Sun, 6 Sep 2015 22:27:11 +0300 (MSK) Date: Sun, 6 Sep 2015 22:27:10 +0300 From: Victor Wagner To: pgsql-hackers@postgresql.org Subject: Discussion summary: Proposal: Implement failover on libpq connect level. Message-ID: <20150906222710.3d6bccdb@wagner.wagner.home> In-Reply-To: <20150818041850.GA5092@wagner.pp.ru> References: <20150818041850.GA5092@wagner.pp.ru> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; i586-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.9 (--) 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 First of all, I wish to thank all the participants of the discussion for their useful suggestions and critics. I see that people are really interested in this feature. Now, list of syntax and behavior changes against original proposal: 1. There is similar feature in JDBC, so syntax of URL-style connect string should be compatible with JDBC: postgresql://host:port,host:port/dbname... 2. In the param=value style connect string, there should be way to specify different non-standard port for each host in the cluster. So on, it seems that people came to conclusion, that allowing host:port syntax as value of the host parameter shouldn't break anything. So, port should be determined following way: If there is :portnumber in the host string, this portnumber takes precedence over anything else for this particular host. To avoid problems with file system objects with strange names, colon is interpreted as port number separator only if value of the host parameter doesn't begin with slash. If it begins with slash, it is handled exactly as it handled now. If port is not explicitly specified in the host string, then use parameter port= (for all hosts, which are not accompanied with own port number), if no port parameter in the connect string, use same chain of fallbacks up to compiled in standard value, as in use now. 3. Simultaneous connection to all the hosts in cluster shouldn't be default. By default hosts should be tried in order they are specified in the connect string. To minimize syntax changes there should be single parameter 'hostorder' which specifies order of hosts with possible choices sequential(default), parallel and random. 4. There should be a way to allow cluster software or system administrator some time to perform failover procedures and promote one of standbys to master. So, there should be additional parameter, failover_timeout, which specifies number of seconds connection attempts should be retried, if no usable master server found. 5. Parameter readonly (which allows to distinguish between failover and load balancing of readonly clients) should be implemented as in original proposal. -- Victor Wagner -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers