Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lS11S-0005WO-G6 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Apr 2021 17:22:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lS11R-000426-DD for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Apr 2021 17:22:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lS11R-00041z-6G for pgsql-hackers@lists.postgresql.org; Thu, 01 Apr 2021 17:22:21 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lS11K-0007vV-6Z for pgsql-hackers@lists.postgresql.org; Thu, 01 Apr 2021 17:22:20 +0000 Received: from hnk.local (p2350207-ipbf2126funabasi.chiba.ocn.ne.jp [114.167.184.207]) by oss.nttdata.com (Postfix) with ESMTPSA id 00C9362738; Fri, 2 Apr 2021 02:22:08 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit To: Bharath Rupireddy Cc: Zhihong Yu , Alexey Kondratov , "Hou, Zhijie" , PostgreSQL Hackers References: <39259f30-897c-ceaf-8a1e-78fe2db398cb@oss.nttdata.com> <8ef4979b-85e7-c3f2-0653-f8f444f5dcff@oss.nttdata.com> <93e8fe47-79c2-ed58-c43b-fdb57b238fa8@oss.nttdata.com> From: Fujii Masao Message-ID: Date: Fri, 2 Apr 2021 02:22:08 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/04/02 1:13, Bharath Rupireddy wrote: > On Thu, Apr 1, 2021 at 8:56 PM Fujii Masao wrote: >> >>> Attaching v21 patch set, rebased onto the latest master. >> >> I agree to add the server-level option. But I'm still not sure if it's good idea to also expose that option as GUC. Isn't the server-level option enough for most cases? >> >> Also it's strange to expose only this option as GUC while there are other many postgres_fdw options? >> >> With v21-002 patch, even when keep_connections GUC is disabled, the existing open connections are not close immediately. Only connections used in the transaction are closed at the end of that transaction. That is, the existing connections that no transactions use will never be closed. I'm not sure if this behavior is intuitive for users. >> >> Therefore for now I'm thinking to support the server-level option at first... Then if we find it's not enough for most cases in practice, I'd like to consider to expose postgres_fdw options including keep_connections as GUC. >> >> Thought? > > +1 to have only a server-level option for now and if the need arises > we could expose it as a GUC. > >> BTW these patches fail to be applied to the master because of commit 27e1f14563. I updated and simplified the 003 patch. Patch attached. > > Thanks for updating the patch. It looks good to me. Just a minor > change, instead of using "true" and "off" for the option, I used "on" > and "off" in the docs. Attaching v23. Thanks a lot! Barring any objection, I will commit this version. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION