postgresql/contrib/postgres_fdw
Etsuro Fujita 700e8fe6d4 postgres_fdw: Fix subabort cleanup of connections used in asynchronous execution.
Commit 27e1f1456 resets the per-connection states of connections used to
scan foreign tables asynchronously during abort cleanup at main
transaction end, but it failed to do so during subabort cleanup at
subtransaction end, leading to a segmentation fault when re-executing an
asynchronous-foreign-table-scan query in a transaction that was
cancelled in a subtransaction of it.

Fix by modifying pgfdw_abort_cleanup() to reset the per-connection state
of a given connection also when called for subabort cleanup.  Also,
modify that function to do the reset in both the abort-cleanup and
subabort-cleanup cases if necessary, to save cycles, and improve a
comment on it a little bit.

Back-patch to v14 where the aforesaid commit came in.

Reviewed by Alexander Pyhalov

Discussion: https://postgr.es/m/CAPmGK14cCV-JA7kNsyt2EUTKvZ4xkr2LNRthi1U1C3cqfGppAw@mail.gmail.com
2022-01-21 17:45:02 +09:00
..
expected Remove assertion for ALTER TABLE .. DETACH PARTITION CONCURRENTLY 2021-12-22 15:38:05 +09:00
sql Remove assertion for ALTER TABLE .. DETACH PARTITION CONCURRENTLY 2021-12-22 15:38:05 +09:00
.gitignore Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
connection.c postgres_fdw: Fix subabort cleanup of connections used in asynchronous execution. 2022-01-21 17:45:02 +09:00
deparse.c postgres_fdw: Fix issues with generated columns in foreign tables. 2021-08-05 20:00:01 +09:00
Makefile postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
option.c Avoid using ambiguous word "non-negative" in error messages. 2021-07-28 01:21:35 +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 Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.c Fix null-pointer crash in postgres_fdw's conversion_error_callback. 2021-10-06 15:50:24 -04:00
postgres_fdw.control postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
postgres_fdw.h postgres_fdw: Fix issues with generated columns in foreign tables. 2021-08-05 20:00:01 +09:00
shippable.c Replace remaining uses of "whitelist". 2021-01-05 14:00:16 +13:00