postgres/contrib/postgres_fdw
Fujii Masao 454aab4b73 postgres_fdw: Fix bug in connection status check.
The buildfarm member "hake" reported a failure in the regression test
added by commit 857df3cef7, where postgres_fdw_get_connections(true)
returned unexpected results.

The function postgres_fdw_get_connections(true) checks
if a connection is closed by using POLLRDHUP in the requested events
and calling poll(). Previously, the function only considered
POLLRDHUP or 0 as valid returned events. However, poll() can also
return POLLHUP, POLLERR, and/or POLLNVAL. So if any of these events
were returned, postgres_fdw_get_connections(true) would report
incorrect results. postgres_fdw_get_connections(true) failed to
account for these return events.

This commit updates postgres_fdw_get_connections(true) to correctly
report a closed connection when poll() returns not only POLLRDHUP
but also POLLHUP, POLLERR, or POLLNVAL.

Discussion: https://postgr.es/m/fd8f6186-9e1e-4b9a-92c5-e71e3697d381@oss.nttdata.com
2024-07-27 03:58:48 +09:00
..
expected postgres_fdw: Add connection status check to postgres_fdw_get_connections(). 2024-07-26 22:16:39 +09:00
sql postgres_fdw: Add connection status check to postgres_fdw_get_connections(). 2024-07-26 22:16:39 +09:00
.gitignore
connection.c postgres_fdw: Fix bug in connection status check. 2024-07-27 03:58:48 +09:00
deparse.c Fixup various StringInfo function usages 2024-04-10 11:53:32 +12:00
Makefile postgres_fdw: Add "used_in_xact" column to postgres_fdw_get_connections(). 2024-07-26 22:15:51 +09:00
meson.build postgres_fdw: Add "used_in_xact" column to postgres_fdw_get_connections(). 2024-07-26 22:15:51 +09:00
option.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
postgres_fdw--1.1--1.2.sql postgres_fdw: Add connection status check to postgres_fdw_get_connections(). 2024-07-26 22:16:39 +09:00
postgres_fdw--1.0--1.1.sql postgres_fdw: Add functions to discard cached connections. 2021-01-26 15:35:54 +09:00
postgres_fdw--1.0.sql
postgres_fdw.c postgres_fdw: Avoid "cursor can only scan forward" error. 2024-07-19 13:15:00 +09:00
postgres_fdw.control postgres_fdw: Add "used_in_xact" column to postgres_fdw_get_connections(). 2024-07-26 22:15:51 +09:00
postgres_fdw.h Make dblink interruptible, via new libpqsrv APIs. 2024-01-08 11:39:56 -08:00
shippable.c Update copyright for 2024 2024-01-03 20:49:05 -05:00