RE: [Proposal] Add foreign-server health checks infrastructure

Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>

From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Fujii Masao' <masao.fujii@oss.nttdata.com>
Cc: 'Katsuragi Yuta' <katsuragiy@oss.nttdata.com>, 'vignesh C' <vignesh21@gmail.com>, 'Ted Yu' <yuzhihong@gmail.com>, 'Tom Lane' <tgl@sss.pgh.pa.us>, "'pgsql-hackers@lists.postgresql.org'" <pgsql-hackers@lists.postgresql.org>, 'Önder Kalacı' <onderkalaci@gmail.com>, "'Shinya11.Kato@oss.nttdata.com'" <Shinya11.Kato@oss.nttdata.com>, 'Kyotaro Horiguchi' <horikyota.ntt@gmail.com>, 'Shubham Khanna' <khannashubham1197@gmail.com>
Date: 2024-09-17T06:08:28Z
Lists: pgsql-hackers
Dear Fujii-san,

Thanks for reviewing!

> I made a couple of small adjustments and attached the updated version.
> If that's ok, I'll go ahead and commit it.
> 
> +         Name of the local user mapped to the foreign server of this
> +         connection, or "public" if a public mapping is used. If the user
> 
> I enclosed "public" with <literal> tag, i.e., <literal>public</literal>.

Right, it should be. I grepped sgml files just in case, but they are tagged by <literal>.

> > I did not done that be cause either of server_name or user_name is NULL and
> > it might be strange. But yes, the example should have more information.
> > Based on that, I added a tuple so that the example has below. Thought?
> >
> > loopback1 - user is "postgres", valid
> > loopback2 - user is "public", valid
> > loopback3 - user is NULL, invalid
> 
> LGTM.
> Also I added the following to the example for clarity:
> 
> postgres=# SELECT * FROM postgres_fdw_get_connections(true);

+1.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Commits

  1. postgres_fdw: Extend postgres_fdw_get_connections to return user name.

  2. postgres_fdw: Fix bug in connection status check.

  3. postgres_fdw: Add connection status check to postgres_fdw_get_connections().

  4. postgres_fdw: Add "used_in_xact" column to postgres_fdw_get_connections().

  5. doc: Enhance documentation for postgres_fdw_get_connections() output columns.

  6. Avoid reference to nonexistent array element in ExecInitAgg().

  7. Add WL_SOCKET_CLOSED for socket shutdown events.

  8. postgres_fdw: reestablish new connection if cached one is detected as broken.