postgresql/src
Heikki Linnakangas b70c2143bb Move a few ResourceOwnerEnlarge() calls for safety and clarity.
These are functions where a lot of things happen between the
ResourceOwnerEnlarge and ResourceOwnerRemember calls. It's important
that there are no unrelated ResourceOwnerRemember calls in the code in
between, otherwise the reserved entry might be used up by the
intervening ResourceOwnerRemember and not be available at the intended
ResourceOwnerRemember call anymore. I don't see any bugs here, but the
longer the code path between the calls is, the harder it is to verify.

In bufmgr.c, there is a function similar to ResourceOwnerEnlarge,
ReservePrivateRefCountEntry(), to ensure that the private refcount
array has enough space. The ReservePrivateRefCountEntry() calls were
made at different places than the ResourceOwnerEnlargeBuffers()
calls. Move the ResourceOwnerEnlargeBuffers() and
ReservePrivateRefCountEntry() calls together for consistency.

Reviewed-by: Aleksander Alekseev, Michael Paquier, Julien Rouhaud
Reviewed-by: Kyotaro Horiguchi, Hayato Kuroda, Álvaro Herrera, Zhihong Yu
Reviewed-by: Peter Eisentraut, Andres Freund
Discussion: https://www.postgresql.org/message-id/cbfabeb0-cd3c-e951-a572-19b365ed314d%40iki.fi
2023-11-08 13:30:46 +02:00
..
backend Move a few ResourceOwnerEnlarge() calls for safety and clarity. 2023-11-08 13:30:46 +02:00
bin Fix the test 003_logical_slots. 2023-11-07 11:32:33 +05:30
common Remove distprep 2023-11-06 15:18:04 +01:00
fe_utils Remove distprep 2023-11-06 15:18:04 +01:00
include Stop including parsenodes.h in plannodes.h 2023-11-07 19:26:39 +01:00
interfaces Remove distprep 2023-11-06 15:18:04 +01:00
makefiles Remove distprep 2023-11-06 15:18:04 +01:00
pl Remove distprep 2023-11-06 15:18:04 +01:00
port Remove distprep 2023-11-06 15:18:04 +01:00
template Use unnamed POSIX semaphores on Cygwin. 2023-01-06 10:33:28 +13:00
test Don't install ldap_password_func in meson 2023-11-08 11:27:28 +01:00
timezone Remove distprep 2023-11-06 15:18:04 +01:00
tools Remove distprep 2023-11-06 15:18:04 +01:00
tutorial Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.shlib Stop using "-multiply_defined suppress" on macOS. 2023-09-26 21:06:21 -04:00
meson.build Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00