Re: [Proposal] Add foreign-server health checks infrastructure
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <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
Date: 2022-10-17T08:26:42Z
Lists: pgsql-hackers
At Mon, 17 Oct 2022 07:27:21 +0000, "kuroda.hayato@fujitsu.com" <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 accessed 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 called from client application. > So it is also not appropriate. > In short, there are no good position to place the function because this 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 Önder mentioned, if I understand what he said correctly. regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
postgres_fdw: Extend postgres_fdw_get_connections to return user name.
- 4f08ab554577 18.0 landed
-
postgres_fdw: Fix bug in connection status check.
- 454aab4b738e 18.0 landed
-
postgres_fdw: Add connection status check to postgres_fdw_get_connections().
- 857df3cef7be 18.0 landed
-
postgres_fdw: Add "used_in_xact" column to postgres_fdw_get_connections().
- c297a47c5f8d 18.0 landed
-
doc: Enhance documentation for postgres_fdw_get_connections() output columns.
- 284c030a10b8 18.0 landed
-
Avoid reference to nonexistent array element in ExecInitAgg().
- 92957ed98c5c 16.0 cited
-
Add WL_SOCKET_CLOSED for socket shutdown events.
- 50e570a59e7f 15.0 cited
-
postgres_fdw: reestablish new connection if cached one is detected as broken.
- 32a9c0bdf493 14.0 cited