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

Commit91c3613

Browse files
committed
Fix assertion failure by an immediate shutdown.
In PM_WAIT_DEAD_END state, checkpointer process must be dead already.But an immediate shutdown could make postmaster's state machinetransition to PM_WAIT_DEAD_END state even if checkpointer process isstill running, and which caused assertion failure. This bug was introducedin commit457d6cf.This patch ensures that postmaster's state machine doesn't transition toPM_WAIT_DEAD_END state in an immediate shutdown while checkpointerprocess is running.
1 parentf347f26 commit91c3613

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3328,19 +3328,21 @@ PostmasterStateMachine(void)
33283328
* PM_WAIT_BACKENDS state ends when we have no regular backends
33293329
* (including autovac workers), no bgworkers (including unconnected
33303330
* ones), and no walwriter, autovac launcher or bgwriter. If we are
3331-
* doing crash recovery then we expect the checkpointer to exit as
3332-
* well, otherwise not. The archiver, stats, and syslogger processes
3333-
* are disregarded since they are not connected to shared memory; we
3334-
* also disregard dead_end children here. Walsenders are also
3335-
* disregarded, they will be terminated later after writing the
3336-
* checkpoint record, like the archiver process.
3331+
* doing crash recovery or an immediate shutdown then we expect
3332+
* the checkpointer to exit as well, otherwise not. The archiver,
3333+
* stats, and syslogger processes are disregarded since
3334+
* they are not connected to shared memory; we also disregard
3335+
* dead_end children here. Walsenders are also disregarded,
3336+
* they will be terminated later after writing the checkpoint record,
3337+
* like the archiver process.
33373338
*/
33383339
if (CountChildren(BACKEND_TYPE_NORMAL |BACKEND_TYPE_WORKER)==0&&
33393340
CountUnconnectedWorkers()==0&&
33403341
StartupPID==0&&
33413342
WalReceiverPID==0&&
33423343
BgWriterPID==0&&
3343-
(CheckpointerPID==0|| !FatalError)&&
3344+
(CheckpointerPID==0||
3345+
(!FatalError&&Shutdown<ImmediateShutdown))&&
33443346
WalWriterPID==0&&
33453347
AutoVacPID==0)
33463348
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp