diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/postmaster/postmaster.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index e6d750d4d38..5a816a2d3a7 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -3328,19 +3328,21 @@ PostmasterStateMachine(void) * PM_WAIT_BACKENDS state ends when we have no regular backends * (including autovac workers), no bgworkers (including unconnected * ones), and no walwriter, autovac launcher or bgwriter. If we are - * doing crash recovery then we expect the checkpointer to exit as - * well, otherwise not. The archiver, stats, and syslogger processes - * are disregarded since they are not connected to shared memory; we - * also disregard dead_end children here. Walsenders are also - * disregarded, they will be terminated later after writing the - * checkpoint record, like the archiver process. + * doing crash recovery or an immediate shutdown then we expect + * the checkpointer to exit as well, otherwise not. The archiver, + * stats, and syslogger processes are disregarded since + * they are not connected to shared memory; we also disregard + * dead_end children here. Walsenders are also disregarded, + * they will be terminated later after writing the checkpoint record, + * like the archiver process. */ if (CountChildren(BACKEND_TYPE_NORMAL | BACKEND_TYPE_WORKER) == 0 && CountUnconnectedWorkers() == 0 && StartupPID == 0 && WalReceiverPID == 0 && BgWriterPID == 0 && - (CheckpointerPID == 0 || !FatalError) && + (CheckpointerPID == 0 || + (!FatalError && Shutdown < ImmediateShutdown)) && WalWriterPID == 0 && AutoVacPID == 0) { |