pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Michael Paquier <michael@paquier.xyz>
To: Fujii Masao <fujii@postgresql.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: postgres_fdw: reestablish new connection if cached one is detect
Date: Wed, 7 Oct 2020 12:54:13 +0900
Message-ID: <14cd32c8-9532-47b8-77d4-b81eb3b192ea@oss.nttdata.com> (raw)
In-Reply-To: <20201007021347.GD2256@paquier.xyz>
References: <E1kPc9v-0005L4-2l@gemulon.postgresql.org>
	<20201007021347.GD2256@paquier.xyz>



On 2020/10/07 11:13, Michael Paquier wrote:
> 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

Thanks for letting me know this!

> 
> 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

This error means that new connection was successfully reestablished
after the cached connection was terminated, and then the above connection
error occurred when issuing "START TRANSACTION" command on that
new connection. There seems no suspicious relevant log messages in the
logfile. So I'm not sure why this error happened, yet.

Per the previous discusson at [1], lorikeet sometimes seems to cause
connection-relation failure in the regression test. So the cause of error
that we faced today also may be lorikeet itself.

[1]
https://www.postgresql.org/message-id/CA+hUKGL3Son9iAeqgjPbXCpU_6hhZhw9X24uNO14mOC4bG0cCA@mail.gmail...

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION





view thread (13+ messages)  latest in thread

Message-ID: <14cd32c8-9532-47b8-77d4-b81eb3b192ea@oss.nttdata.com>
Permalink:  ../14cd32c8-9532-47b8-77d4-b81eb3b192ea@oss.nttdata.com/
Also on:    postgresql.org/message-id/14cd32c8-9532-47b8-77d4-b81eb3b192ea@oss.nttdata.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: masao.fujii@oss.nttdata.com, michael@paquier.xyz, fujii@postgresql.org
  Subject: Re: pgsql: postgres_fdw: reestablish new connection if cached one is detect
  In-Reply-To: <14cd32c8-9532-47b8-77d4-b81eb3b192ea@oss.nttdata.com>
  References: <E1kPc9v-0005L4-2l@gemulon.postgresql.org> <20201007021347.GD2256@paquier.xyz> <14cd32c8-9532-47b8-77d4-b81eb3b192ea@oss.nttdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox