Re: Unexpected behavior after OOM errors

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unexpected behavior after OOM errors
Date: 2026-06-19 07:22:28
Message-ID: CAEze2WiD0+bc_LzrVFswV7_830Nvz9AzopYhf2bqXVv65xb9ZA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 19 Jun 2026 at 01:30, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Thu, Jun 18, 2026 at 05:27:57PM +0200, Matthias van de Meent wrote:
> > By moving StandbyAcquireAccessExclusiveLock's LockAcquire ahead of
> > when it links the lock to the transaction, the local data structure
> > doesn't know to clean up the lock until after it's acquired, so
> > failure in that process won't make error cleanup try to clean up the
> > lock.
>
> Yep, reordering these two actions would take care of the list
> inconsistency where the startup process goes down following the ERROR
> promoted to a FATAL.
>
> I have been fingering the idea of backpatching this fix for a few
> minutes, actually, but discarded the idea at the end. It does not
> require a random pattern to cause the failure, being actionable
> through a combination of GUCs as Alexander has proved. Still, the
> only consequence is an extra LOG entry telling that the lock is not
> being tracked for non-assert builds. Confusing, OK, but not really
> critical.
>
> Comments?

Because it fixes an assertion, I'd vote for backpatching; but because
the case is handled safely without assertions I also wouldn't be upset
if it wasn't backpatched.

-Matthias

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shlok Kyal 2026-06-19 07:48:34 Re: [PATCH] Preserve replication origin OIDs in pg_upgrade
Previous Message Florents Tselai 2026-06-19 07:19:11 Re: More jsonpath methods: translate, split, join