]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix assertion failure with latch wait in single-user mode
authorMichael Paquier <michael@paquier.xyz>
Fri, 25 Jul 2025 07:17:31 +0000 (16:17 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 25 Jul 2025 07:17:31 +0000 (16:17 +0900)
commitf7dfccf9605dab54956321e236de3415a2ba2fa3
tree2b9251cd84ff26a8363f1591db802b85461d1e1e
parent2973b1cd3a8005a35a9303c37602468aeb01dfeb
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
src/backend/storage/ipc/latch.c