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 1nMPy6-0002LN-5y for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Feb 2022 07:52:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nMPy3-0001eY-67 for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Feb 2022 07:52:15 +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 1nMPy2-0001eP-T1 for pgsql-hackers@lists.postgresql.org; Tue, 22 Feb 2022 07:52:14 +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 1nMPxy-0008Dn-7l for pgsql-hackers@lists.postgresql.org; Tue, 22 Feb 2022 07:52:13 +0000 Received: from [192.168.11.10] (p2010165-ipbf2302funabasi.chiba.ocn.ne.jp [122.25.95.165]) by oss.nttdata.com (Postfix) with ESMTPSA id 061E0604BF; Tue, 22 Feb 2022 16:52:04 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.5 at oss.nttdata.com Message-ID: <4968741d-f32c-a251-efc9-2d3db83e6891@oss.nttdata.com> Date: Tue, 22 Feb 2022 16:52:03 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [Proposal] Add foreign-server health checks infrastructure Content-Language: en-US To: "kuroda.hayato@fujitsu.com" , 'Kyotaro Horiguchi' Cc: "pgsql-hackers@lists.postgresql.org" , "Shinya11.Kato@oss.nttdata.com" , "zyu@yugabyte.com" References: <20220216.115058.1615761004338301624.horikyota.ntt@gmail.com> <20220217.170832.627054018291482509.horikyota.ntt@gmail.com> <379473f3-ed14-a19f-92ed-91dc73d430d3@oss.nttdata.com> From: Fujii Masao In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022/02/22 15:41, kuroda.hayato@fujitsu.com wrote: > Cfbot is still angry because of missing PGDLLIMPORT, so attached. Thanks for updating the patches! The connection check timer is re-scheduled repeatedly even while the backend is in idle state or is running a local transaction that doesn't access to any foreign servers. I'm not sure if it's really worth checking the connections even in those states. Even without the periodic connection checks, if the connections are closed in those states, subsequent GetConnection() will detect that closed connection and re-establish the connection when starting remote transaction. Thought? When a closed connection is detected in idle-in-transaction state and SIGINT is raised, nothing happens because there is no query running to be canceled by SIGINT. Also in this case the connection check timer gets disabled. So we can still execute queries that don't access to foreign servers, in the same transaction, and then the transaction commit fails. Is this expected behavior? When I shutdowned the foreign server while the local backend is in idle-in-transaction state, the connection check timer was triggered and detected the closed connection. Then when I executed COMMIT command, I got the following WARNING message. Is this a bug? WARNING: leaked hash_seq_search scan for hash table 0x7fd2ca878f20 Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION