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 1okLSV-0007L8-CN for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Oct 2022 08:26:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1okLST-0001uU-Ve for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Oct 2022 08:26:49 +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 1okLST-0001uC-LQ for pgsql-hackers@lists.postgresql.org; Mon, 17 Oct 2022 08:26:49 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1okLSS-0006dp-CR for pgsql-hackers@lists.postgresql.org; Mon, 17 Oct 2022 08:26:49 +0000 Received: by mail-pj1-x1036.google.com with SMTP id n18-20020a17090ade9200b0020b0012097cso12523119pjv.0 for ; Mon, 17 Oct 2022 01:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=Or3DtgYqLOvYQOdfM8SgdCy1R1WEDYRoWw+PtTwJ5Ao=; b=oWHxAjg5LwykSRtHF8WmDUYIxtAwWWEOve63osB9BFwxs4s1KX9V6xnqaGrWD6a8EH GhnNwiWilZuJwPdc7b5QwmB9aKyBornpMXqSiowNiv4IsdWimNNDsmYgW1V7OyOUY6oG YezYyjQlGg9Gkv6ZJtOCi0UO1HB/9wJZKYnB0SRIRGXPllUR2vk4vZ2y6iIDUZOmKPxF R/D4YlcIBM11rKZO5mJnu/nuTa8xSdTjyqYho9uuWtDMSPzdWIJnncNmX9T8zjIrxCQm +AD+lcAjso1Bt4ZY4X5T0MuokA70FYtP5W3eICLm1+b19q5IziaWzSqIJ8abbnz1JZEq Bb8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Or3DtgYqLOvYQOdfM8SgdCy1R1WEDYRoWw+PtTwJ5Ao=; b=1xXpKH3xjx2xC8tJJ/AxXQYn3+BbhbU4lTVOOClSzp4OK2eYpHFJmjIkzmXvG5ym1j UT6jJsG+1eAIryyNa40qO92pUnlpmbQe3orfb0IGwKjvFVrW8Fgf/8+cOv6fl93EKrkN 8/JnaK5S4FV9xEXpUOAekXXLuKTzQVmZ+yWpkbMWmCqoRfjPsPChyWoGQns0BSSrYyz/ qPYVTDzW73IRyw0JIxOcOpg15Wd/3BS/304s/0Xicl7o/pKtaN+aHfU0GtBw1I7YgM1T VaC7ZpKw5V7YNzdDf3+M5ex6Q/FuuHgFwO3RGdyI8QdiDN2ti+45pRhom7o6ctv+E551 zUTw== X-Gm-Message-State: ACrzQf1koHrOTp1mPUDiyvVmZn8cbtNfrWgJWnuapV7l2phkcXYEI2C0 sz1tZ888ViTBUbrltu/ION4= X-Google-Smtp-Source: AMsMyM7oruIYTx02lbcq35z9uvqQPmBpsUs1S4WtXeHMHktxzBZuqxyeBXnhoWYg969VxciiKoXAhQ== X-Received: by 2002:a17:903:230a:b0:17d:707a:360e with SMTP id d10-20020a170903230a00b0017d707a360emr10802489plh.118.1665995206038; Mon, 17 Oct 2022 01:26:46 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id a19-20020aa794b3000000b0053e42167a33sm6434666pfl.53.2022.10.17.01.26.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 17 Oct 2022 01:26:45 -0700 (PDT) Date: Mon, 17 Oct 2022 17:26:42 +0900 (JST) Message-Id: <20221017.172642.45253962719866795.horikyota.ntt@gmail.com> To: kuroda.hayato@fujitsu.com Cc: onderkalaci@gmail.com, andres@anarazel.de, masao.fujii@oss.nttdata.com, pgsql-hackers@lists.postgresql.org, Shinya11.Kato@oss.nttdata.com, zyu@yugabyte.com Subject: Re: [Proposal] Add foreign-server health checks infrastructure From: Kyotaro Horiguchi In-Reply-To: References: User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Mon, 17 Oct 2022 07:27:21 +0000, "kuroda.hayato@fujitsu.com" wrote in = > > In other words, a variation of pgfdw_connection_check_internal() > > could potentially go into interfaces/libpq/libpq-fe.h > > (backend/libpq/pqcomm.c or src/interfaces/libpq/fe-connect.c). > = > Hmm, IIUC libpq related function and data structures cannot be access= ed from core source, > so we cannot move to pqcomm.c. > (This is a motivation for introducing libpqwalreceiver library. It is= used to avoid to link libpq directly) > And functions in libpq/fe-connect.c will be included libpq.so, > but latch related functions like WaitEventSetWait() should not be cal= led from client application. > So it is also not appropriate. > In short, there are no good position to place the function because th= is requires both of libpq and core functions. Might be on slight different direction, but it looks to me a bit too much to use WaitEventSet to check only if a socket is live or not. A quick search in the tree told me that we could use pqSocketCheck() instead, and I think it would be the something that "could potentially go into libpq-fe.h" as =D6nder mentioned, if I understand what he said correctly. regards. -- = Kyotaro Horiguchi NTT Open Source Software Center