Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf7dfccf

Browse files
michaelpqrdunklau
andcommitted
Fix assertion failure with latch wait in single-user mode
LatchWaitSetPostmasterDeathPos, the latch event position for thepostmaster 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 dropin single-user mode while waiting in WaitForProcSignalBarrier() afterthe drop.Oversight in commit84e5b2f.Author: Patrick Stählin <me@packi.ch>Co-authored-by: Ronan Dunklau <ronan.dunklau@aiven.io>Discussion:https://postgr.es/m/18996-3a2744c8140488de@postgresql.orgBackpatch-through: 18
1 parent2973b1c commitf7dfccf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/backend/storage/ipc/latch.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,11 @@ WaitLatch(Latch *latch, int wakeEvents, long timeout,
187187
if (!(wakeEvents&WL_LATCH_SET))
188188
latch=NULL;
189189
ModifyWaitEvent(LatchWaitSet,LatchWaitSetLatchPos,WL_LATCH_SET,latch);
190-
ModifyWaitEvent(LatchWaitSet,LatchWaitSetPostmasterDeathPos,
191-
(wakeEvents& (WL_EXIT_ON_PM_DEATH |WL_POSTMASTER_DEATH)),
192-
NULL);
190+
191+
if (IsUnderPostmaster)
192+
ModifyWaitEvent(LatchWaitSet,LatchWaitSetPostmasterDeathPos,
193+
(wakeEvents& (WL_EXIT_ON_PM_DEATH |WL_POSTMASTER_DEATH)),
194+
NULL);
193195

194196
if (WaitEventSetWait(LatchWaitSet,
195197
(wakeEvents&WL_TIMEOUT) ?timeout :-1,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp