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 1oZl9T-0007Pd-0Y for pgsql-hackers@arkaria.postgresql.org; Sun, 18 Sep 2022 03:39:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oZl9Q-0001yS-19 for pgsql-hackers@arkaria.postgresql.org; Sun, 18 Sep 2022 03:39:24 +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 1oZl9P-0001yG-Ny for pgsql-hackers@lists.postgresql.org; Sun, 18 Sep 2022 03:39:23 +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 1oZl9M-0004gS-8r for pgsql-hackers@lists.postgresql.org; Sun, 18 Sep 2022 03:39:22 +0000 Received: from [172.20.10.7] (sp1-75-202-10.msb.spmode.ne.jp [1.75.202.10]) by oss.nttdata.com (Postfix) with ESMTPSA id C69D5600B7; Sun, 18 Sep 2022 12:39:14 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.7 at oss.nttdata.com Message-ID: <2160c6db-079a-be7c-df96-6c5cb21c03cf@oss.nttdata.com> Date: Sun, 18 Sep 2022 12:39:14 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.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> <4968741d-f32c-a251-efc9-2d3db83e6891@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/03/04 15:17, kuroda.hayato@fujitsu.com wrote: > Hi Hackers, > >> It's not happy, but I'm not sure about a good solution. I made a timer reschedule >> if connection lost had detected. But if queries in the transaction are quite short, >> catching SIGINT may be fail. > > Attached uses another way: sets pending flags again if DoingCommandRead is true. > If a remote server goes down while it is in idle_in_transaction, > next query will fail because of ereport(ERROR). > > How do you think? Sounds ok to me. Thanks for updating the patches! These failed to be applied to the master branch cleanly. Could you update them? + this option relies on kernel events exposed by Linux, macOS, s/this/This + GUC_check_errdetail("pgfdw_health_check_interval must be set to 0 on this platform"); The actual parameter name "postgres_fdw.health_check_interval" should be used for the message instead of internal variable name. + /* Register a timeout for checking remote servers */ + pgfdw_health_check_timeout = RegisterTimeout(USER_TIMEOUT, pgfdw_connection_check); This registered signal handler does lots of things. But that's not acceptable and they should be performed outside signal handler. No? Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION