Re: pgsql: postgres_fdw: reestablish new connection if cached one is detect - Mailing list pgsql-committers

From Michael Paquier
Subject Re: pgsql: postgres_fdw: reestablish new connection if cached one is detect
Date
Msg-id 20201007021347.GD2256@paquier.xyz
Whole thread Raw
In response to pgsql: postgres_fdw: reestablish new connection if cached one is detect  (Fujii Masao <fujii@postgresql.org>)
Responses Re: pgsql: postgres_fdw: reestablish new connection if cached one is detect  (Fujii Masao <masao.fujii@oss.nttdata.com>)
List pgsql-committers
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 broken.
>
> 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.
>
> 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=lorikeet&dt=2020-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 abort
+CONTEXT:  remote SQL command: START TRANSACTION ISOLATION LEVEL REPEATABLE READ
--
Michael

Attachment

pgsql-committers by date:

Previous
From: Noah Misch
Date:
Subject: Re: pgsql: Fix race in test of pg_switch_wal().
Next
From: Michael Paquier
Date:
Subject: Re: pgsql: Fix race in test of pg_switch_wal().