Re: Unexpected behavior after OOM errors

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
Cc: Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unexpected behavior after OOM errors
Date: 2026-07-22 00:56:03
Message-ID: amAVI75rmLDiJ7rR@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 21, 2026 at 02:24:13PM +0200, Matthias van de Meent wrote:
> I think I found the source of these Asserts; the attached fixes it.
> The problem is that we're registering the type entry handling as 'in
> progress' before the cache is initialized, and the error handling hook
> for in-progress type entries initializes the TYPEOID cache if there's
> an in-progress entry and the cache wasn't already initialized. And,
> initializing this catcache in non-transactional contexts isn't
> allowed, so the error handling causes the assertion to fail.

I was wondering if this update should happen further down, but that
led to an inconsistent handling of the in-progress list within the
post-error callback. Looking at that a second time, just moving it
down the initial lookup seems fine enough. Applied after an edit of
the comment section.

> Next, I'll be looking at the last issue.

The pgstat one? That would help a lot, thanks! If you are not
familiar with the internals of this area in the backend, this problem
should give a pretty good introduction.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-07-22 01:29:23 Re: injection_points: canceled or terminated waiters leak their wait slots
Previous Message Fujii Masao 2026-07-22 00:40:10 Re: Validate SERVER subscription conninfo during ALTER SUBSCRIPTION ... OWNER TO