postgres_fdw: Add connection status check to postgres_fdw_get_connections().
authorFujii Masao <[email protected]>
Fri, 26 Jul 2024 13:16:39 +0000 (22:16 +0900)
committerFujii Masao <[email protected]>
Fri, 26 Jul 2024 13:16:39 +0000 (22:16 +0900)
commit857df3cef7be93f7b9214c926e7af6f06a8cf23e
treef687728abb8e507acc88ebdf773598d2148418fb
parentc297a47c5f8da78d976e8c3f790dbeeb6a21a853
postgres_fdw: Add connection status check to postgres_fdw_get_connections().

This commit extends the postgres_fdw_get_connections() function
to check if connections are closed. This is useful for detecting closed
postgres_fdw connections that could prevent successful transaction
commits. Users can roll back transactions immediately upon detecting
closed connections, avoiding unnecessary processing of failed
transactions.

This feature is available only on systems supporting the non-standard
POLLRDHUP extension to the poll system call, including Linux.

Author: Hayato Kuroda
Reviewed-by: Shinya Kato, Zhihong Yu, Kyotaro Horiguchi, Andres Freund
Reviewed-by: Onder Kalaci, Takamichi Osumi, Vignesh C, Tom Lane, Ted Yu
Reviewed-by: Katsuragi Yuta, Peter Smith, Shubham Khanna, Fujii Masao
Discussion: https://postgr.es/m/TYAPR01MB58662809E678253B90E82CE5F5889@TYAPR01MB5866.jpnprd01.prod.outlook.com
contrib/postgres_fdw/connection.c
contrib/postgres_fdw/expected/postgres_fdw.out
contrib/postgres_fdw/postgres_fdw--1.1--1.2.sql
contrib/postgres_fdw/sql/postgres_fdw.sql
doc/src/sgml/postgres-fdw.sgml