OSDN Git Service

More fixes for shutdown during recovery.
authorRobert Haas <rhaas@postgresql.org>
Wed, 26 May 2010 12:32:41 +0000 (12:32 +0000)
committerRobert Haas <rhaas@postgresql.org>
Wed, 26 May 2010 12:32:41 +0000 (12:32 +0000)
commit615704af1e5868c6fc9001ee5daef68db6d10f76
tree51dfb8fcb91f334d6d136210f89d2ee0d9b349de
parent20d629320b8ccc899a763155d85cbc0e87b0982b
More fixes for shutdown during recovery.

1. If we receive a fast shutdown request while in the PM_STARTUP state,
process it just as we would in PM_RECOVERY, PM_HOT_STANDBY, or PM_RUN.
Without this change, an early fast shutdown followed by Hot Standby causes
the database to get stuck in a state where a shutdown is pending (so no new
connections are allowed) but the shutdown request is never processed unless
we end Hot Standby and enter normal running.

2. Avoid removing the backup label file when a smart or fast shutdown occurs
during recovery.  It makes sense to do this once we've reached normal running,
since we must be taking a backup which now won't be valid.  But during
recovery we must be recovering from a previously taken backup, and any backup
label file is needed to restart recovery from the right place.

Fujii Masao and Robert Haas
src/backend/postmaster/postmaster.c