postgresql/src/backend
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
..
access Enlarge assertion in bloom_init() for false_positive_rate 2023-11-08 14:06:26 +09:00
archive Redesign archive modules 2023-02-17 14:26:42 +09:00
backup Change struct tablespaceinfo's oid member from 'char *' to 'Oid' 2023-10-23 15:17:26 -04:00
bootstrap Remove distprep 2023-11-06 15:18:04 +01:00
catalog Remove distprep 2023-11-06 15:18:04 +01:00
commands Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
executor Fix intra-query memory leak when a SRF returns zero rows. 2023-10-28 14:05:01 -04:00
foreign Expand some more uses of "deleg" to "delegation" or "delegated". 2023-05-21 10:55:18 -04:00
jit Remove distprep 2023-11-06 15:18:04 +01:00
lib Make binaryheap available to frontend code. 2023-09-18 12:18:33 -07:00
libpq Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
main Remove obsolete defense against strxfrm() bugs. 2023-04-20 13:20:14 +12:00
nodes Remove distprep 2023-11-06 15:18:04 +01:00
optimizer Fix allocation of UniqueRelInfo 2023-11-06 10:04:01 +02:00
parser Compute aggregate argument types correctly in transformAggregateCall(). 2023-11-06 10:38:00 -05:00
partitioning Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
po Translation updates 2023-08-07 12:39:30 +02:00
port Remove distprep 2023-11-06 15:18:04 +01:00
postmaster pgindent run to fix commits de64268561 and 5ae2087202 2023-10-30 14:52:35 -04:00
regex Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
replication Make use of initReadOnlyStringInfo() in more places 2023-11-07 11:16:43 +13:00
rewrite Add TupleDescGetDefault() 2023-09-27 18:52:40 +01:00
snowball Remove distprep 2023-11-06 15:18:04 +01:00
statistics Take pg_attribute out of VacAttrStats 2023-07-03 07:18:57 +02:00
storage Move a few ResourceOwnerEnlarge() calls for safety and clarity. 2023-11-08 13:30:46 +02:00
tcop Introduce the concept of read-only StringInfos 2023-10-26 16:31:48 +13:00
tsearch Limit to_tsvector_byid's initial array allocation to something sane. 2023-09-25 11:50:28 -04:00
utils Move a few ResourceOwnerEnlarge() calls for safety and clarity. 2023-11-08 13:30:46 +02:00
.gitignore
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
meson.build Add win32ver data to meson-built postgres.exe. 2023-06-12 07:40:38 -07:00
nls.mk Remove distprep 2023-11-06 15:18:04 +01:00