Re: FDW Foreign Table Access: strange LOG message - Mailing list pgsql-general

From Tom Lane
Subject Re: FDW Foreign Table Access: strange LOG message
Date
Msg-id 30297.1521574736@sss.pgh.pa.us
Whole thread Raw
In response to Re: FDW Foreign Table Access: strange LOG message  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: FDW Foreign Table Access: strange LOG message  (Albrecht Dreß <albrecht.dress@arcor.de>)
List pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> On 03/20/2018 11:52 AM, Albrecht Dreß wrote:
>> I use Postgres 10.3 on a Debian Stretch system with foreign tables, and 
>> noticed strange LOG messages when accessing them.
>> [time stamp/pid] user@my_db LOG:  could not receive data from client: 
>> Connection reset by peer

> My suspicion is it has to do with this:
> postgres_fdw establishes a connection to a foreign server during the 
> first query that uses a foreign table associated with the foreign 
> server. This connection is kept and re-used for subsequent queries in 
> the same session.

Perhaps.  It's not entirely clear if these complaints are about the
original user session or the sub-session opened by postgres_fdw.
(Albrecht, if you're not sure either, enabling log_connections and
log_disconnections might make it clearer.)

I don't see any such log messages when testing postgres_fdw here,
which is odd; why are my results different?

If these are about the FDW connections, maybe the answer is that
postgres_fdw ought to establish a backend-exit callback in which
it can shut down its connections gracefully.  If it's doing that
now, I sure don't see where.

            regards, tom lane


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: FATAL: semctl(15073290, 4, SETVAL, 0) failed: Invalid argument
Next
From: Christoph Berg
Date:
Subject: Re: postgresql-10.3 on unbuntu-17.10 - how??