pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix assertion failure with latch wait in single-user mode
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix assertion failure with latch wait in single-user mode
@ 2025-07-25 07:17 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2025-07-25 07:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix assertion failure with latch wait in single-user mode
@ 2025-07-25 07:17 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2025-07-25 07:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f7dfccf9605dab54956321e236de3415a2ba2fa3

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-07-25 07:17 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-07-25 07:17 pgsql: Fix assertion failure with latch wait in single-user mode Michael Paquier <michael@paquier.xyz>
2025-07-25 07:17 pgsql: Fix assertion failure with latch wait in single-user mode Michael Paquier <michael@paquier.xyz>

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