pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Hou, Zhijie <houzj.fnst@cn.fujitsu.com>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: Alexey Kondratov <a.kondratov@postgrespro.ru>
Subject: Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit
Date: Mon, 18 Jan 2021 15:28:04 +0900
Message-ID: <8ec46200-4e34-556c-f7cd-476255aa5419@oss.nttdata.com> (raw)
In-Reply-To: <e7ddd14e96444fce88e47a709c196537@G08CNEXMBPEKD05.g08.fujitsu.local>
References: <CALj2ACVvrp5=AVp2PupEm+nAC8S4buqR3fJMmaCoc7ftT0aD2A@mail.gmail.com>
	<CALj2ACUF_FNpQfi-RYP0Vhg24BLeuZF=QAc0JyVJ=O=yCKFSDA@mail.gmail.com>
	<f9bb39dd-628c-1c85-5bce-52a420a2fbef@oss.nttdata.com>
	<CALj2ACUHD4z1dw2g2nGt1G3nyKMDS8qR__Df8aDycbe24EZPaA@mail.gmail.com>
	<82debcd7-b236-0fc5-5ff1-5e6b99c59d64@oss.nttdata.com>
	<CALj2ACX-DzNSV3-mJzi+k0gk6kHKFpt64xYXZy0vLh3+hXqFSg@mail.gmail.com>
	<CALj2ACWFbFau2aUchkLpMOWEPH0ipJEJyh-XjUkZU0985OYJMw@mail.gmail.com>
	<55bd82c5-d133-6fbb-f1f4-e25c1509c96e@oss.nttdata.com>
	<CALj2ACWqsVXK0-Mxcp05KtiUFE2HgWbdiww3uFzVZtdOUSGJ1A@mail.gmail.com>
	<CALj2ACXSQq4XQbpzMYSM3uKUzfqtp3Un9o_yErf1SNxHvDXg6Q@mail.gmail.com>
	<CALNJ-vTHJBFBVnxJ2soHhAg6UrCAD9RgMF9RF6yj5AhTuJM-mg@mail.gmail.com>
	<CALj2ACVEadzaB88ZRVF499nFxdO5pBTMCDJ0xG9kvLVhea0eYg@mail.gmail.com>
	<c2a00f21-a80d-8bce-e2ea-8cd8e16c4da9@oss.nttdata.com>
	<CALj2ACURjjg8wVpfb-s8GE+4ycQcx6z+QGQOM3TC_Cjz+=Lq6w@mail.gmail.com>
	<e7ddd14e96444fce88e47a709c196537@G08CNEXMBPEKD05.g08.fujitsu.local>



On 2021/01/18 15:02, Hou, Zhijie wrote:
>> We need to create the loopback3 with user mapping public, otherwise the
>> test might become unstable as shown below. Note that loopback and
>> loopback2 are not dropped in the test, so no problem with them.
>>
>>   ALTER SERVER loopback OPTIONS (ADD use_remote_estimate 'off');  DROP
>> SERVER loopback3 CASCADE;
>>   NOTICE:  drop cascades to 2 other objects
>> -DETAIL:  drop cascades to user mapping for postgres on server loopback3
>> +DETAIL:  drop cascades to user mapping for bharath on server loopback3
>>
>> Attaching v2 patch for postgres_fdw_get_connections. Please have a look.
> Hi
> 
> I have a comment for the doc about postgres_fdw_get_connections.
> 
> +    <term><function>postgres_fdw_get_connections(OUT server_name text, OUT valid boolean) returns setof record</function></term>
> +    <listitem>
> +     <para>
> +      This function returns the foreign server names of all the open
> +      connections that <filename>postgres_fdw</filename> established from
> +      the local session to the foreign servers. It also returns whether
> +      each connection is valid or not. <literal>false</literal> is returned
> +      if the foreign server connection is used in the current local
> +      transaction but its foreign server or user mapping is changed or
> +      dropped, and then such invalid connection will be closed at
> +      the end of that transaction. <literal>true</literal> is returned
> +      otherwise. If there are no open connections, no record is returned.
> +      Example usage of the function:
> 
> The doc seems does not memtion the case when the function returns NULL in server_name.
> Users may be a little confused about why NULL was returned.

Yes, so what about adding

     (Note that the returned server name of invalid connection is NULL if its server is dropped)

into the following (just after "dropped")?

+      if the foreign server connection is used in the current local
+      transaction but its foreign server or user mapping is changed or
+      dropped

Or better description?

Regards,

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





view thread (175+ messages)  latest in thread

Message-ID: <8ec46200-4e34-556c-f7cd-476255aa5419@oss.nttdata.com>
Permalink:  ../8ec46200-4e34-556c-f7cd-476255aa5419@oss.nttdata.com/
Also on:    postgresql.org/message-id/8ec46200-4e34-556c-f7cd-476255aa5419@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-hackers@postgresql.org
  Cc: masao.fujii@oss.nttdata.com, houzj.fnst@cn.fujitsu.com, bharath.rupireddyforpostgres@gmail.com, zyu@yugabyte.com, a.kondratov@postgrespro.ru
  Subject: Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit
  In-Reply-To: <8ec46200-4e34-556c-f7cd-476255aa5419@oss.nttdata.com>
  References: <CALj2ACVvrp5=AVp2PupEm+nAC8S4buqR3fJMmaCoc7ftT0aD2A@mail.gmail.com> <f9bb39dd-628c-1c85-5bce-52a420a2fbef@oss.nttdata.com> <CALj2ACUHD4z1dw2g2nGt1G3nyKMDS8qR__Df8aDycbe24EZPaA@mail.gmail.com> <82debcd7-b236-0fc5-5ff1-5e6b99c59d64@oss.nttdata.com> <CALj2ACX-DzNSV3-mJzi+k0gk6kHKFpt64xYXZy0vLh3+hXqFSg@mail.gmail.com> <CALj2ACWFbFau2aUchkLpMOWEPH0ipJEJyh-XjUkZU0985OYJMw@mail.gmail.com> <55bd82c5-d133-6fbb-f1f4-e25c1509c96e@oss.nttdata.com> <CALj2ACWqsVXK0-Mxcp05KtiUFE2HgWbdiww3uFzVZtdOUSGJ1A@mail.gmail.com> <CALj2ACXSQq4XQbpzMYSM3uKUzfqtp3Un9o_yErf1SNxHvDXg6Q@mail.gmail.com> <CALNJ-vTHJBFBVnxJ2soHhAg6UrCAD9RgMF9RF6yj5AhTuJM-mg@mail.gmail.com> <CALj2ACVEadzaB88ZRVF499nFxdO5pBTMCDJ0xG9kvLVhea0eYg@mail.gmail.com> <c2a00f21-a80d-8bce-e2ea-8cd8e16c4da9@oss.nttdata.com> <CALj2ACURjjg8wVpfb-s8GE+4ycQcx6z+QGQOM3TC_Cjz+=Lq6w@mail.gmail.com> <e7ddd14e96444fce88e47a709c196537@G08CNEXMBPEKD05.g08.fujitsu.local> <8ec46200-4e34-556c-f7cd-476255aa5419@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