postgresql/src
Thomas Munro a722252ef1 Back-patch b1ffe3ff into REL_13_STABLE.
This is a cherry pick of 4c8e00ae from the 14 branch into the 13 branch.

It avoids an assertion failure when ForwardSyncRequest() tries to
allocate memory while trying to compact the queue, if run in a critical
section.  RelationTruncate() gained a critical section in 38c579b0, and
could fail in that way in the 13 branch.

b1ffe3ff originally fixed the same problem with TruncateMultiXact(), but
for that case it only needed to go back as far as 14, where SLRUs
started using the sync request queue.  It also fixed a related deadlock
risk that doesn't apply in this case (this case doesn't wait), but it
might exist in theory and it doesn't hurt to keep the code the same as
later branches.

Author: Heikki Linnakangas <heikki.linnakangas@iki.fi> (original commit)
Reviewed-by: Michael Paquier <michael@paquier.xyz> (in this new context)
Reported-by: Yura Sokolov <y.sokolov@postgrespro.ru>
Discussion: https://postgr.es/m/f98aaa79-80b5-47c9-832a-31416a3a528b%40postgrespro.ru
2025-01-09 10:14:11 +13:00
..
backend Back-patch b1ffe3ff into REL_13_STABLE. 2025-01-09 10:14:11 +13:00
bin pgbench: fix misprocessing of some nested \if constructs. 2024-12-15 14:14:15 -05:00
common Fix overread in JSON parsing errors for incomplete byte sequences 2024-05-09 12:45:51 +09:00
fe_utils Clean up assorted failures under clang's -fsanitize=undefined checks. 2022-03-03 18:13:24 -05:00
include Restore smgrtruncate() prototype in back-branches. 2025-01-08 10:48:57 +13:00
interfaces Fix broken list-munging in ecpg's remove_variables(). 2024-12-01 14:15:37 -05:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Add support for Tcl 9 2024-11-25 13:11:49 +01:00
port Fix lstat() for broken junction points on Windows. 2024-11-08 09:46:39 +10:30
template On NetBSD, force dynamic symbol resolution at postmaster start. 2022-08-30 17:29:08 -04:00
test In REASSIGN OWNED of a database, lock the tuple as mandated. 2024-12-28 07:16:27 -08:00
timezone Update time zone data files to tzdata release 2024b. 2024-10-29 11:50:10 -04:00
tools Skip SectionMemoryManager.h in cpluspluscheck. 2024-11-28 15:48:52 +13:00
tutorial Doc: sync src/tutorial/basics.source with SGML documentation. 2022-11-19 13:09:14 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Suppress macOS warnings about duplicate libraries in link commands. 2023-09-29 14:07:30 -04:00
Makefile.shlib Stop using "-multiply_defined suppress" on macOS. 2023-09-26 21:06:21 -04:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00