pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Albrecht Dreß <albrecht.dress@arcor.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: FDW Foreign Table Access: strange LOG message
Date: Wed, 21 Mar 2018 11:25:54 -0700
Message-ID: <6b34f8c0-4064-1695-8cdf-5e5469ed7ea0@aklaver.com> (raw)
In-Reply-To: <4LEJPNQI.ZWASSFGA.Q7QOROSI@UY3LDXOV.Y5MUB6GM.BGMWW4SO>
References: <4LEJPNQI.ZWASSFGA.Q7QOROSI@UY3LDXOV.Y5MUB6GM.BGMWW4SO>

On 03/21/2018 11:15 AM, Albrecht Dreß wrote:
> Hi Adrian & Tom:
> 
> Thanks a lot for your input!
> 
> Am 20.03.18 20:38 schrieb(en) Tom Lane:

See comments inline below.
> 
> Unfortunately, in my original post, I confused the primary and secondary 
> (accessed via the FDW) data bases in my example when I anonymised their 
> identifiers…  Sorry for the confusion!  The /real/ structure is
> 
>      client ---[libpq]--> my_db ---[FDW]--> ext_db
> 
> and the LOG message is actually related to the “internal” connection, 
> i.e. ext_db (*not* my_db) complains about “could not receive data” after 
> accessing the table in ext_db through the FDW from my_db.
> 
> The effect is not limited to Python, but happens with psql, too.  I.e. 
> running (ext_table is the foreign table mapped into my_db, and a mapping 
> exists only for user “user”)
> 
> sudo -u user /usr/lib/postgresql/10/bin/psql my_db <<< "select * from 
> ext_table limit 1;"
> 
> *also* triggers the LOG message

Does it also happen when you open a psql session and do?:

psql>select * from ext_table limit 1;

> 
> [time stamp/pid] user@ext_db LOG:  could not receive data from client: 
> Connection reset by peer
> 
>> I don't see any such log messages when testing postgres_fdw here, 
>> which is odd; why are my results different?
> 
> Yes, that's strange!  I have the following deb packages (from the 
> stretch-pgdg repo) installed:
> 
> postgresql-10            10.3-1.pgdg90+1 amd64
> postgresql-client-10     10.3-1.pgdg90+1 amd64
> postgresql-client-common 190.pgdg90+1    all
> postgresql-common        190.pgdg90+1    all
> libpq5:amd64             10.3-1.pgdg90+1 amd64

I am not seeing --contrib which is where I would expect postgres_fdw to 
come from.

Is --contrib installed?

If not where is postgres_fdw coming from?

> 
>> 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.
> 
> Hmm, yes, sounds like a sensible explanation.
> 
>> If it's doing that now, I sure don't see where.
> 
> So, if I understand you correctly, this needs to be addressed in 
> postgres_fdw, and there is nothing I can fix in my setup (except for 
> suppressing LOG messages) to get rid of the message?
> 
> Thanks again,
> Albrecht.


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (12+ messages)  latest in thread

Message-ID: <6b34f8c0-4064-1695-8cdf-5e5469ed7ea0@aklaver.com>
Permalink:  ../6b34f8c0-4064-1695-8cdf-5e5469ed7ea0@aklaver.com/
Also on:    postgresql.org/message-id/6b34f8c0-4064-1695-8cdf-5e5469ed7ea0@aklaver.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-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, albrecht.dress@arcor.de, tgl@sss.pgh.pa.us
  Subject: Re: FDW Foreign Table Access: strange LOG message
  In-Reply-To: <6b34f8c0-4064-1695-8cdf-5e5469ed7ea0@aklaver.com>
  References: <4LEJPNQI.ZWASSFGA.Q7QOROSI@UY3LDXOV.Y5MUB6GM.BGMWW4SO> <6b34f8c0-4064-1695-8cdf-5e5469ed7ea0@aklaver.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