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 1n4zgJ-0000mC-BT for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Jan 2022 06:21:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n4zgH-0005pe-Od for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Jan 2022 06:21:53 +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 1n4zgH-0005pV-Fh for pgsql-hackers@lists.postgresql.org; Wed, 05 Jan 2022 06:21:53 +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 1n4zgE-0005bc-UY for pgsql-hackers@lists.postgresql.org; Wed, 05 Jan 2022 06:21:52 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 1F61660793; Wed, 5 Jan 2022 15:21:47 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.4 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 05 Jan 2022 15:21:47 +0900 From: Shinya Kato To: kuroda.hayato@fujitsu.com Cc: pgsql-hackers@lists.postgresql.org, zyu@yugabyte.com Subject: Re: [Proposal] Add foreign-server health checks infrastructure In-Reply-To: References: <54449d7bea79263e937266ad6ebc65b3@oss.nttdata.com> <4e64bb8a0a88f5b6ac5a8901377c81af@oss.nttdata.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <4a2059d419eec5671a6d167cb83229db@oss.nttdata.com> X-Sender: Shinya11.Kato@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thank you for the new patch! On 2021-12-15 15:40, kuroda.hayato@fujitsu.com wrote: > Dear Kato-san, > > Thank you for giving comments! And sorry for late reply. > I rebased my patches. > >> Even for local-only transaction, I thought it useless to execute >> CallCheckingRemoteServersCallbacks() and enable_timeout_after(). Can I >> make it so that it determines outside whether it contains SQL to the >> remote or not? > > Yeah, remote-checking timeout will be enable even ifa local > transaction is opened. > In my understanding, postgres cannot distinguish whether opening > transactions > are using only local object or not. > My first idea was that turning on the timeout when GetFdwRoutineXXX > functions > were called, but in some cases FDWs may not use remote connection even > if > they call such a handler function. e.g. postgresExplainForeignScan(). > Hence I tried another approach that unregister all checking callback > the end of each transactions. Only FDWs can notice that transactions > are remote or local, > so they must register callback when they really connect to other > database. > This implementation will avoid calling remote checking in the case of > local transaction, > but multiple registering and unregistering may lead another overhead. > I attached which implements that. > It certainly incurs another overhead, but I think it's better than the previous one. So far, I haven't encountered any problems, but I'd like other people's opinions. >> The following points are minor. >> 1. In foreign.c, some of the lines are too long and should be broken. >> 2. In pqcomm.c, the newline have been removed, what is the intention >> of >> this? >> 3. In postgres.c, >> 3-1. how about inserting a comment between lines 2713 and 2714, >> similar >> to line 2707? >> 3-2. the line breaks in line 3242 and line 3243 should be aligned. >> 3-3. you should change >> /* >> * Skip checking foreign servers while reading >> messages. >> */ >> to >> /* >> * Skip checking foreign servers while reading >> messages. >> */ >> 4. In connection.c, There is a typo in line 1684, so "fucntion" should >> be changed to "function". > > Maybe all of them were fixed. Thanks! Thank you, and it looks good to me. -- Regards, -- Shinya Kato Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION