postgresql/src/backend/utils/cache
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
..
Makefile Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
attoptcache.c Remove useless casts to (void *) in hash_search() calls 2023-02-06 09:41:01 +01:00
catcache.c Move a few ResourceOwnerEnlarge() calls for safety and clarity. 2023-11-08 13:30:46 +02:00
evtcache.c Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
inval.c Reorder two functions in inval.c 2023-11-07 11:55:13 +09:00
lsyscache.c Add missing ObjectIdGetDatum() in syscache lookup calls for Oids 2023-07-20 15:18:25 +09:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
partcache.c Add missing ObjectIdGetDatum() in syscache lookup calls for Oids 2023-07-20 15:18:25 +09:00
plancache.c Avoid unnecessary plancache revalidation of utility statements. 2023-08-24 12:02:46 -04:00
relcache.c Remove RelationGetIndexRawAttOptions() 2023-10-03 17:51:02 +02:00
relfilenumbermap.c Remove useless casts to (void *) in hash_search() calls 2023-02-06 09:41:01 +01:00
relmapper.c Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
spccache.c Remove useless casts to (void *) in hash_search() calls 2023-02-06 09:41:01 +01:00
syscache.c Add sanity asserts for index OID and attnums during cache init 2023-07-27 10:55:16 +09:00
ts_cache.c Remove useless casts to (void *) in hash_search() calls 2023-02-06 09:41:01 +01:00
typcache.c Fix exception safety bug in typcache.c. 2023-09-13 14:58:22 +12:00