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 1nBVY0-0000WK-UU for pgsql-hackers@arkaria.postgresql.org; Sun, 23 Jan 2022 05:36:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nBVXy-0005WJ-24 for pgsql-hackers@arkaria.postgresql.org; Sun, 23 Jan 2022 05:36:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nBVXx-0005W9-P6 for pgsql-hackers@lists.postgresql.org; Sun, 23 Jan 2022 05:36:13 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nBVXs-0001oC-GH for pgsql-hackers@lists.postgresql.org; Sun, 23 Jan 2022 05:36:12 +0000 Received: from [172.20.10.7] (sp49-98-212-124.msd.spmode.ne.jp [49.98.212.124]) by oss.nttdata.com (Postfix) with ESMTPSA id 48AF0600FF; Sun, 23 Jan 2022 14:36:03 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.4 at oss.nttdata.com Message-ID: <0e9ea094-67df-487c-96f5-f9eabb5357c7@oss.nttdata.com> Date: Sun, 23 Jan 2022 14:36:02 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [Proposal] Add foreign-server health checks infrastructure Content-Language: en-US To: "kuroda.hayato@fujitsu.com" , "zyu@yugabyte.com" Cc: "pgsql-hackers@lists.postgresql.org" , 'Shinya Kato' References: <54449d7bea79263e937266ad6ebc65b3@oss.nttdata.com> <4e64bb8a0a88f5b6ac5a8901377c81af@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/01/21 15:08, kuroda.hayato@fujitsu.com wrote: > Dear Fujii-san, Zhihong, > > I attached the latest version. Thanks for updating the patch! +int +TryDisableRemoteServerCheckingTimeout(void) When more than one FDWs are used, even if one FDW calls this function to disable the timeout, its remote-server-check-callback can still be called. Is this OK? Please imagine the case where two FDWs are used and they registered their callbacks. Even when one FDW calls TryDisableRemoteServerCheckingTimeout(), if another FDW has not called that yet, the timeout is still being enabled. If the timeout is triggered during that period, even the callback registered by the FDW that has already called TryDisableRemoteServerCheckingTimeout() would be called. + if (remote_servers_connection_check_interval > 0) + { + CallCheckingRemoteServersCallbacks(); + enable_timeout_after(CHECKING_REMOTE_SERVERS_TIMEOUT, + remote_servers_connection_check_interval); LockErrorCleanup() needs to be called before reporting the error, doesn't it? This can cause an error even while DoingCommandRead == true. Is that safe? > The biggest change is that callbacks are no longer un-registered at the end of transactions. > FDW developer must enable or disable timeout instead, via new APIs. > > The timer will be turned on when: > * new GUC is >= 0, and This can cause the timeout to be enabled even when no remote transaction is started? Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION