Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMGuR-0008WR-Mw for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Nov 2018 18:26:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gMGsJ-0007pE-Ki for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Nov 2018 18:23:51 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMGsJ-0007oG-DI for pgsql-hackers@lists.postgresql.org; Mon, 12 Nov 2018 18:23:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMGsF-0003k7-KG for pgsql-hackers@postgresql.org; Mon, 12 Nov 2018 18:23:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wACINWsn026891; Mon, 12 Nov 2018 13:23:33 -0500 From: Tom Lane To: Laurenz Albe cc: Haribabu Kommi , Robert Haas , Jing Wang , Pg Hackers , "Tsunakawa, Takayuki" Subject: Re: Libpq support to connect to standby server as priority In-reply-to: <67be09458f276c0c95a4b2a2a383dca9775d19cd.camel@cybertec.at> References: <1530710078.2411.29.camel@cybertec.at> <67be09458f276c0c95a4b2a2a383dca9775d19cd.camel@cybertec.at> Comments: In-reply-to Laurenz Albe message dated "Fri, 09 Nov 2018 12:53:01 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26889.1542047012.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 12 Nov 2018 13:23:32 -0500 Message-ID: <26890.1542047012@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Laurenz Albe writes: > Haribabu Kommi wrote: >> Added comments along the lines that you mentioned. And also try >> to update some more comments. > Looks ok to me, I'll mark it as "ready for committer". I don't like this patch at all: the business with keeping two connections open seems impossibly fragile and full of race conditions. (For instance, by the time you return the read-only session to the application, it might not be read-only any more. I also wonder what inquiry functions like PQsocket ought to return while in this state.) I think the feature definition needs to be re-thought to make that unnecessary. Also, we really need to consider the interaction between this and the feature(s) being discussed in the thread at https://www.postgresql.org/message-id/flat/1700970.cRWpxnom9y%40hammer.mag= icstack.net regards, tom lane