Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPyxo-0006lo-9s for pgsql-committers@arkaria.postgresql.org; Wed, 07 Oct 2020 02:13:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kPyxn-0003LA-4K for pgsql-committers@arkaria.postgresql.org; Wed, 07 Oct 2020 02:13:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPyxm-0003L3-VX for pgsql-committers@lists.postgresql.org; Wed, 07 Oct 2020 02:13:54 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPyxk-0004wt-62 for pgsql-committers@lists.postgresql.org; Wed, 07 Oct 2020 02:13:54 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6DBAB5C007D; Tue, 6 Oct 2020 22:13:51 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 06 Oct 2020 22:13:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=SEtvrGosImaxTnAhvBHfB2ukdTd epwW4ytC7x7KYfus=; b=TS032Fz7lz9sSXsNUrbgIMY3uE2xianmtGDxFDJEfs3 YJTzn417eAhlH27iod9sCKms+iOktv6W2tVSpxUIEoW+o3Vm88ObUUQUzT5Vi34q Bj2/IipVASOAkpwitUYZzv2xo5fc1wNvD1uzaBIb1tMceVJaKFasbnJN7EIseWa8 xZ2w0yED0lp84om3qKqRiosoLjLGf+820/NmbiPKs6Hnmeh8gtkd0ediW2Ki9Bd7 0j+YTA8Vm1ibm8DLhnLcym3fe09E8c8GVsnBHHyPIwi1iRH0uZ4AOcL+dYljl1Qt OP/Vz+JtJoCFQMJdKMYxq0kZCWzuaTaBTFLCVmTNYsA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=SEtvrG osImaxTnAhvBHfB2ukdTdepwW4ytC7x7KYfus=; b=djbaZhuV038rAvnnk+3swY W80uDTxDYsVqKjio83XBH7LoMuC1f08jpeo0hy4yMUVCUxFmz9okK1v4E7YGSaLg CNri6oHE3d/1XQBNpuWM7vmz+ZG11n+vjrnsIaeLniWPSNxXFdXSeoy5JoUznvwv icmdtvg6jJL9+yjpQfpF8UWjr771krUpJvW/Wf3pAhy64fXobCmptX4ABl2tMe52 8E2A236OXUmFBOyVHgvKAJyAc4J/ari9TqlDa6/EmCD2sL/2CrGTuaWlCBQ37cTr GYq5O5dMyTjSAhy1YaA0pCjT6WipshTCmwPNyrIhIZUmGIVjqPr/DE+KmncqfvyA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrgeehgdehiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepffdufeeflefghfekudekkeevvddu gfeiteekkeduleefvefhhffftdduffeiuedtnecuffhomhgrihhnpehpohhsthhgrhgvsh hqlhdrohhrghenucfkphepudduuddruddtvddrudektddrudekheenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquh hivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 0201D3064683; Tue, 6 Oct 2020 22:13:49 -0400 (EDT) Date: Wed, 7 Oct 2020 11:13:47 +0900 From: Michael Paquier To: Fujii Masao Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: postgres_fdw: reestablish new connection if cached one is detect Message-ID: <20201007021347.GD2256@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qGV0fN9tzfkG3CxV" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --qGV0fN9tzfkG3CxV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Fujii-san, On Tue, Oct 06, 2020 at 01:52:55AM +0000, Fujii Masao wrote: > postgres_fdw: reestablish new connection if cached one is detected as bro= ken. >=20 > In postgres_fdw, once remote connections are established, they are cached > and re-used for subsequent queries and transactions. There can be some > cases where those cached connections are unavaiable, for example, > by the restart of remote server. In these cases, previously an error was > reported and the query accessing to remote server failed if new remote > transaction failed to start because the cached connection was broken. >=20 > This commit improves postgres_fdw so that new connection is remade > if broken connection is detected when starting new remote transaction. > This is useful to avoid unnecessary failure of queries when connection is > broken but can be reestablished. lorikeet is telling that the test introduced by this commit is unstable: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dlorikeet&dt=3D202= 0-10-06%2008%3A28%3A36 Some details: BEGIN; SELECT 1 FROM ft1 LIMIT 1; - ?column? ----------- - 1 -(1 row) - +ERROR: could not receive data from server: Software caused connection abo= rt +CONTEXT: remote SQL command: START TRANSACTION ISOLATION LEVEL REPEATABLE= READ -- Michael --qGV0fN9tzfkG3CxV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl99JFsACgkQnvQgOdby QH20GxAAjcJH4FRplnd0BhZwko0+H7vc4O6Lb1zzAsiCUHiQQPJqcmgJwyjCOwpT z6f7yzOXQHgWFgOA3GhM5q/8WlwnJqoXC2bd0Kq/S6hCP5BCBMTfaofbRQjlMWVP NiNXDXteSRWJGv9wO4nKm9ATtk5uoIJ4lUfH85KzRr/89GWZciqM9a5VDxLfUyTZ Zq0oDNdtAj8ZLBM3uDH71gL54Hm88DXRstaQlUqU55MyMAu0myrTwocQEAKw7v/Y Nl0jJX7QaGIpIfczh18+nF8c4nNfUpluo/W+6leqphzjB4FbbE8zivADmDhh8ZwN 1b2x6w0LsfCCL9L/o7X5Z1ohj03LVNMw80Rx6wBjNggZKVEMeOzIwPfTeZ/QE4NC o90eXUnnAC5nXJkblJrJd/OCyZpHpVXA2GJoEp81othM688XnHS32upGVIkZfR7T WQzOycd4FDrT3J/E2SMvjXmSHWa3Eg17qJvc123RHxTLiGmKfOG/pz6eeHnSBqYS Kkiz2Fu5yEsY+Z+SzzbFRmCV1JRlJko6HHSlIRVJ5wjj5HMICRvJoUY9IeT1S+2H T3z5p54/ghCzXd74lfT6LSrhUvNMJTHQX7fzcbEdTA1Cqffq8h9ye5uRy0RhAhV5 Fi7k4Y01T+8mIduc9SW+vYB//vNeTcGcypeFGZ0BuU/hTrdwBKM= =zfg6 -----END PGP SIGNATURE----- --qGV0fN9tzfkG3CxV--