pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: Alexander Lakhin <exclusion@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Unexpected behavior after OOM errors
Date: Wed, 22 Jul 2026 09:56:03 +0900
Message-ID: <amAVI75rmLDiJ7rR@paquier.xyz> (raw)
In-Reply-To: <CAEze2Wjbkh7UBEii+U8yHwL_4x-SSAmw_5=m8t-XX136yJthoQ@mail.gmail.com>
References: <e77acaac-a1b3-40b3-99ee-5769b4e453e4@gmail.com>
	<CAEze2Wgktuo+_QWfbALRW-UXXZhbSC+OgGGDFDV9m_BLy5KozQ@mail.gmail.com>
	<ajN2DkXPOzzC1GSj@paquier.xyz>
	<CAEze2Wj3HUz+Z4A8GaoSQyP1V_qGZEkxhp6dquF3+gNyoAmJNw@mail.gmail.com>
	<ajSFcksGRhNJEs5H@paquier.xyz>
	<CAEze2Wjh4_VmtD8C54q2drth2HSkCzBtgMZocuwj=z2gLDFcNQ@mail.gmail.com>
	<ajUkLyWHxCeFVop_@paquier.xyz>
	<ajZFM1XwbDpTQYZV@paquier.xyz>
	<95c64dc2-3abe-4f4e-b285-4c681f565d9f@gmail.com>
	<CAEze2Wjbkh7UBEii+U8yHwL_4x-SSAmw_5=m8t-XX136yJthoQ@mail.gmail.com>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (32+ messages)  latest in thread

Message-ID: <amAVI75rmLDiJ7rR@paquier.xyz>
Permalink:  ../amAVI75rmLDiJ7rR@paquier.xyz/
Also on:    postgresql.org/message-id/amAVI75rmLDiJ7rR@paquier.xyz

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: michael@paquier.xyz, boekewurm+postgres@gmail.com, exclusion@gmail.com
  Subject: Re: Unexpected behavior after OOM errors
  In-Reply-To: <amAVI75rmLDiJ7rR@paquier.xyz>
  References: <e77acaac-a1b3-40b3-99ee-5769b4e453e4@gmail.com> <CAEze2Wgktuo+_QWfbALRW-UXXZhbSC+OgGGDFDV9m_BLy5KozQ@mail.gmail.com> <ajN2DkXPOzzC1GSj@paquier.xyz> <CAEze2Wj3HUz+Z4A8GaoSQyP1V_qGZEkxhp6dquF3+gNyoAmJNw@mail.gmail.com> <ajSFcksGRhNJEs5H@paquier.xyz> <CAEze2Wjh4_VmtD8C54q2drth2HSkCzBtgMZocuwj=z2gLDFcNQ@mail.gmail.com> <ajUkLyWHxCeFVop_@paquier.xyz> <ajZFM1XwbDpTQYZV@paquier.xyz> <95c64dc2-3abe-4f4e-b285-4c681f565d9f@gmail.com> <CAEze2Wjbkh7UBEii+U8yHwL_4x-SSAmw_5=m8t-XX136yJthoQ@mail.gmail.com> <amAVI75rmLDiJ7rR@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox