pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit
Date: Tue, 14 Jul 2020 12:58:22 -0400
Message-ID: <20200714165822.GE7628@momjian.us> (raw)
In-Reply-To: <CALj2ACUFNydy0uo0JL9A1isHQ9pFe1Fgqa_HVanfG6F8g21nSQ@mail.gmail.com>
References: <CALj2ACVvrp5=AVp2PupEm+nAC8S4buqR3fJMmaCoc7ftT0aD2A@mail.gmail.com>
	<CA+fd4k4pQxU_rs6n8qW+1K-gJU1UFe+mFEn8xu1nRHuMXxBKPg@mail.gmail.com>
	<CALj2ACU72u1baCMyNvnumrdiyr42YHLppAd0aPA5=VJU1Orj5w@mail.gmail.com>
	<CA+TgmobL+ZO1xo9i9GB0z1izjktMo-=R1BHhSsmC11kW5UvJ4g@mail.gmail.com>
	<CALj2ACWF4mV5+rPZUjjokYJ=9hNwZ0=M-keENmQRzbwqFQajCw@mail.gmail.com>
	<CA+TgmoaBQMCM9dTU4qUKOw80tk77AsMxgbF1hRxq3tA5SNuFtg@mail.gmail.com>
	<CALj2ACUFNydy0uo0JL9A1isHQ9pFe1Fgqa_HVanfG6F8g21nSQ@mail.gmail.com>

On Tue, Jul 14, 2020 at 03:38:49PM +0530, Bharath Rupireddy wrote:
> Approach #4:
> A postgres_fdw foreign server level option: connection idle time, the
> amount of idle time for that server cached entry, after which the
> cached entry goes away. Probably the backend, before itself going to
> idle, has to be checking the cached entries and see if any of the
> entries has timed out. One problem is that, if the backend just did it
> before going idle, then what about sessions that haven't reached the
> timeout at the point when we go idle, but do reach the timeout later?

Imagine implementing idle_in_session_timeout (which is useful on its
own), and then, when you connect to a foreign postgres_fdw server, you
set idle_in_session_timeout on the foreign side, and it just
disconnects/exits after an idle timeout.  There is nothing the sending
side has to do.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee






view thread (175+ messages)  latest in thread

Message-ID: <20200714165822.GE7628@momjian.us>
Permalink:  ../20200714165822.GE7628@momjian.us/
Also on:    postgresql.org/message-id/20200714165822.GE7628@momjian.us

 · 

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: bruce@momjian.us, bharath.rupireddyforpostgres@gmail.com
  Subject: Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit
  In-Reply-To: <20200714165822.GE7628@momjian.us>
  References: <CALj2ACVvrp5=AVp2PupEm+nAC8S4buqR3fJMmaCoc7ftT0aD2A@mail.gmail.com> <CA+fd4k4pQxU_rs6n8qW+1K-gJU1UFe+mFEn8xu1nRHuMXxBKPg@mail.gmail.com> <CALj2ACU72u1baCMyNvnumrdiyr42YHLppAd0aPA5=VJU1Orj5w@mail.gmail.com> <CA+TgmobL+ZO1xo9i9GB0z1izjktMo-=R1BHhSsmC11kW5UvJ4g@mail.gmail.com> <CALj2ACWF4mV5+rPZUjjokYJ=9hNwZ0=M-keENmQRzbwqFQajCw@mail.gmail.com> <CA+TgmoaBQMCM9dTU4qUKOw80tk77AsMxgbF1hRxq3tA5SNuFtg@mail.gmail.com> <CALj2ACUFNydy0uo0JL9A1isHQ9pFe1Fgqa_HVanfG6F8g21nSQ@mail.gmail.com> <20200714165822.GE7628@momjian.us>

* 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