pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix assertion failure with latch wait in single-user mode
Date: Fri, 25 Jul 2025 07:17:58 +0000
Message-ID: <E1ufCgo-000dR3-0j@gemulon.postgresql.org> (raw)

Fix assertion failure with latch wait in single-user mode

LatchWaitSetPostmasterDeathPos, the latch event position for the
postmaster death event, is initialized under IsUnderPostmaster.
WaitLatch() considered it as a valid wait target in single-user mode
(!IsUnderPostmaster), which was incorrect.

One code path found to fail with an assertion failure is a database drop
in single-user mode while waiting in WaitForProcSignalBarrier() after
the drop.

Oversight in commit 84e5b2f07a5e.

Author: Patrick Stählin <me@packi.ch>
Co-authored-by: Ronan Dunklau <ronan.dunklau@aiven.io>
Discussion: https://postgr.es/m/18996-3a2744c8140488de@postgresql.org
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/641f20d4c433b66df2928408fb2b44bd165c2329

Modified Files
--------------
src/backend/storage/ipc/latch.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1ufCgo-000dR3-0j@gemulon.postgresql.org>
Permalink:  ../E1ufCgo-000dR3-0j@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ufCgo-000dR3-0j@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: Fix assertion failure with latch wait in single-user mode
  In-Reply-To: <E1ufCgo-000dR3-0j@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox