pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: Alexey Kondratov <a.kondratov@postgrespro.ru>
Cc: Hou, Zhijie <houzj.fnst@cn.fujitsu.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit
Date: Mon, 1 Feb 2021 16:13:27 +0900
Message-ID: <8ef4979b-85e7-c3f2-0653-f8f444f5dcff@oss.nttdata.com> (raw)
In-Reply-To: <CALj2ACUpiKR9QVOLOhpmEPjh4vCtA0_xMEBgZd2-HRSB1wdH=w@mail.gmail.com>
References: <CALj2ACVvrp5=AVp2PupEm+nAC8S4buqR3fJMmaCoc7ftT0aD2A@mail.gmail.com>
	<CALj2ACVcpU=wB7G=zT8msVHvPs0-y0BbviupiT+f3--bGYaOMA@mail.gmail.com>
	<646119f3-fd27-7fd7-5377-b72310af5d21@oss.nttdata.com>
	<62431587-ed3a-f333-51a9-967ccf2a78db@oss.nttdata.com>
	<CALj2ACWFrQAQGSQfaa-rY0YwY3yicqiPELN7tuN9T05uPDnzeg@mail.gmail.com>
	<1c643738-6e52-565d-0261-740d490b550e@oss.nttdata.com>
	<CALj2ACWG6Cqy1Ye5WYEhK3YnBURKk7QsXXmVpPK1xVPwcj7cyw@mail.gmail.com>
	<09b3f740-896d-7507-95e1-d2afd87daf2e@oss.nttdata.com>
	<CALj2ACUJtiCjnqcfQDT5q0C7O=PanN_rtgjkuh7mMh4uuzXf7w@mail.gmail.com>
	<64ee084b-1368-e044-debd-69cc156276c6@oss.nttdata.com>
	<CALj2ACXGwV=qTzZ+ELo+tKR9pUb52r+CFVah4hpBwGViGPMOig@mail.gmail.com>
	<CALj2ACVr+vo+D46uLEATX5fVFPCQRiuKRydxnSy7E6ZwUzBT=w@mail.gmail.com>
	<39259f30-897c-ceaf-8a1e-78fe2db398cb@oss.nttdata.com>
	<CALj2ACUwqO74-amff63Lr1VU1F7WrWEK_28+iT_Ubf8htjZzLg@mail.gmail.com>
	<CALj2ACUpiKR9QVOLOhpmEPjh4vCtA0_xMEBgZd2-HRSB1wdH=w@mail.gmail.com>



On 2021/01/27 10:06, Bharath Rupireddy wrote:
> On Tue, Jan 26, 2021 at 8:38 AM Bharath Rupireddy
> <bharath.rupireddyforpostgres@gmail.com> wrote:
>> I will post "keep_connections" GUC and "keep_connection" server level
>> option patches later.
> 
> Attaching v19 patch set for "keep_connections" GUC and
> "keep_connection" server level option. Please review them further.

These options are no longer necessary because we now support idle_session_timeout? If we want to disconnect the foreign server connections that sit on idle to prevent them from eating up the connection capacities in the foriegn servers, we can just set idle_session_timeout in those foreign servers. If we want to avoid the cluster-wide setting of idle_session_timeout, we can set that per role. One issue for this approach is that the connection entry remains even after idle_session_timeout happens. So postgres_fdw_get_connections() returns that connection even though it's actually closed by the timeout. Which is confusing. But which doesn't cause any actual problem, right? When the foreign table is accessed the next time, that connection entry is dropped, an error is detected, and then new connection will be remade.

Sorry I've not read the past long discussion about this feature. If there is the consensus that these options are still necessary and useful even when we have idle_session_timeout, please correct me.

ISTM that it's intuitive (at least for me) to add this kind of option into the foreign server. But I'm not sure if it's good idea to expose the option as GUC. Also if there is the consensus about this, please correct me.

Regards,

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





view thread (175+ messages)  latest in thread

Message-ID: <8ef4979b-85e7-c3f2-0653-f8f444f5dcff@oss.nttdata.com>
Permalink:  ../8ef4979b-85e7-c3f2-0653-f8f444f5dcff@oss.nttdata.com/
Also on:    postgresql.org/message-id/8ef4979b-85e7-c3f2-0653-f8f444f5dcff@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, bharath.rupireddyforpostgres@gmail.com, zyu@yugabyte.com, a.kondratov@postgrespro.ru, houzj.fnst@cn.fujitsu.com
  Subject: Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit
  In-Reply-To: <8ef4979b-85e7-c3f2-0653-f8f444f5dcff@oss.nttdata.com>
  References: <CALj2ACVvrp5=AVp2PupEm+nAC8S4buqR3fJMmaCoc7ftT0aD2A@mail.gmail.com> <646119f3-fd27-7fd7-5377-b72310af5d21@oss.nttdata.com> <62431587-ed3a-f333-51a9-967ccf2a78db@oss.nttdata.com> <CALj2ACWFrQAQGSQfaa-rY0YwY3yicqiPELN7tuN9T05uPDnzeg@mail.gmail.com> <1c643738-6e52-565d-0261-740d490b550e@oss.nttdata.com> <CALj2ACWG6Cqy1Ye5WYEhK3YnBURKk7QsXXmVpPK1xVPwcj7cyw@mail.gmail.com> <09b3f740-896d-7507-95e1-d2afd87daf2e@oss.nttdata.com> <CALj2ACUJtiCjnqcfQDT5q0C7O=PanN_rtgjkuh7mMh4uuzXf7w@mail.gmail.com> <64ee084b-1368-e044-debd-69cc156276c6@oss.nttdata.com> <CALj2ACXGwV=qTzZ+ELo+tKR9pUb52r+CFVah4hpBwGViGPMOig@mail.gmail.com> <CALj2ACVr+vo+D46uLEATX5fVFPCQRiuKRydxnSy7E6ZwUzBT=w@mail.gmail.com> <39259f30-897c-ceaf-8a1e-78fe2db398cb@oss.nttdata.com> <CALj2ACUwqO74-amff63Lr1VU1F7WrWEK_28+iT_Ubf8htjZzLg@mail.gmail.com> <CALj2ACUpiKR9QVOLOhpmEPjh4vCtA0_xMEBgZd2-HRSB1wdH=w@mail.gmail.com> <8ef4979b-85e7-c3f2-0653-f8f444f5dcff@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