agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve lookup_type_cache() handling on out-of-memory errors
Date: Wed, 22 Jul 2026 00:52:31 +0000
Message-ID: <E1wmLCJ-00000000ElS-0Ylc@gemulon.postgresql.org> (raw)
Improve lookup_type_cache() handling on out-of-memory errors
If an error happens during the initialization of the TYPEOID catcache,
as part of lookup_type_cache(), the error handling of that lookup would
cause an assertion failure via finalize_in_progress_typentries(), called
during error recovery, the presence of an in-progress type OID causing
a catcache initialization outside of a transaction context.
The in-progress list is now delayed to happen after the initial entry
lookup. Alexander Lakhin has found a fancy way to reproduce the
problem, with the injection of probabilistic memory allocation failures.
This problem is unlikely going to show up in practice. Like the other
changes of this kind, no backpatch is done.
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Matthias van de Meent <boekewurm+postgres@gmail.com>
Discussion: https://postgr.es/m/95c64dc2-3abe-4f4e-b285-4c681f565d9f@gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/ccfd4b683867a5eded09a82b624992c87396d02d
Modified Files
--------------
src/backend/utils/cache/typcache.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
Message-ID: <E1wmLCJ-00000000ElS-0Ylc@gemulon.postgresql.org>
Permalink: ../E1wmLCJ-00000000ElS-0Ylc@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wmLCJ-00000000ElS-0Ylc@gemulon.postgresql.org
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Improve lookup_type_cache() handling on out-of-memory errors
In-Reply-To: <E1wmLCJ-00000000ElS-0Ylc@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox