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 1i7ieC-0002Up-8C for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Sep 2019 16:05:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i7ieB-0001Zy-4W for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Sep 2019 16:05:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i7ie9-0000aH-Tu for pgsql-hackers@lists.postgresql.org; Tue, 10 Sep 2019 16:05:38 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i7ie6-00079x-LS for pgsql-hackers@postgresql.org; Tue, 10 Sep 2019 16:05:36 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B3DF221C46; Tue, 10 Sep 2019 12:05:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 10 Sep 2019 12:05:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=+piw1zHBgVn0wk9mgIGfBA9iBtjvC2yyfHtzMW/ITzo=; b=FB9/fV05 xrqn6KYrDHqk8xj4wqhBeQ5835KZc545XVjAioZyafl3iExIa7KI06pk6mIKnN0q uNNuqZl7sBOdUt6kcKDz3HU0+TrPl1kma0SGAmFZNiADxby3txNWIKzh2xCLH68J +5m/kjS4q9KSFdqZy8S1BrkIFDtzEQ94Bg53pC5UQdP/OM9sbKGm1UA9/jrK0Hvn QUhUMvF9MxCRNFT19Vdmrz9WeCGLGvNJfshpgzvgiaqTwOfS4V7U/6VAapUZahKv luQNUr+SRzMjVjlq8SzpxzUDBU2wKxQ9nPvVMcDyWXQGzOqjVLpF8poY2Xa6WkiC 4Lu5rUXEV6JOXQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrtddtgdejgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcufhhrohhmucdvnhgusfhurggurhgrnhhtuceorghlvhhhvghrrh gvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecuffhomhgrihhnpedvnhguqhhurggurhgr nhhtrdgtohhmnecukfhppeduledtrdduvddurddvledrfeenucfrrghrrghmpehmrghilh hfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghenucevlhhushht vghrufhiiigvpedt X-ME-Proxy: Received: from nimloth.alvh.no-ip.org (unknown [190.121.29.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 040588005A; Tue, 10 Sep 2019 12:05:31 -0400 (EDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 11CFC123A8B; Tue, 10 Sep 2019 13:05:29 -0300 (-03) Date: Tue, 10 Sep 2019 13:05:29 -0300 From: Alvaro Herrera from 2ndQuadrant To: Haribabu Kommi Cc: "Tsunakawa, Takayuki" , Robert Haas , Laurenz Albe , Tom Lane , Dave Cramer , Jing Wang , PostgreSQL-development Subject: Re: Libpq support to connect to standby server as priority Message-ID: <20190910160529.GA11336@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190909171949.GA31491@alvherre.pgsql> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Sep-09, Alvaro Herrera from 2ndQuadrant wrote: > Question about 0001. In the CONNECTION_SETENV state, you end by falling > through to the CONNECTION_CHECK_TARGET case; but in that switch it seems > a bit unnatural to do that. I think doing "goto keep_trying" is another > way of doing the same thing, but more in line with what every other > piece of code does. Appears to work. Pushed like that. Testing protocol version 2 is difficult! Almost every single test fails because of error messages being reported differently; and streaming replication (incl. pg_basebackup) doesn't work at all because it's not possible to establish replication connections. Manual inspection shows it behaves correctly. Remaining patchset attached (per my count it's v13 of your patchset. Please use "git format-patch -v14" and so on when posting patches). I stripped the doc change from 0001 (unchanged) because I found it hard to justify on its own, and it has a couple of grammatical mistakes. I think we should merge one half of it with each of the other two patches where the changes are introduced (0003 and 0004). I'm not convinced that we need 0004-0006 to be separate commits. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services