* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.415 2010/06/02 09:28:44 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.416 2010/06/03 03:19:59 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
ereport(LOG,
(errmsg("database system was shut down at %s",
str_time(ControlFile->time))));
+ else if (ControlFile->state == DB_SHUTDOWNED_IN_RECOVERY)
+ ereport(LOG,
+ (errmsg("database system was shut down in recovery at %s",
+ str_time(ControlFile->time))));
else if (ControlFile->state == DB_SHUTDOWNING)
ereport(LOG,
(errmsg("database system shutdown was interrupted; last known up at %s",
lastCheckPoint.redo.xlogid, lastCheckPoint.redo.xrecoff)));
UpdateMinRecoveryPoint(InvalidXLogRecPtr, true);
+ if (flags & CHECKPOINT_IS_SHUTDOWN)
+ {
+ LWLockAcquire(ControlFileLock, LW_EXCLUSIVE);
+ ControlFile->state = DB_SHUTDOWNED_IN_RECOVERY;
+ ControlFile->time = (pg_time_t) time(NULL);
+ UpdateControlFile();
+ LWLockRelease(ControlFileLock);
+ }
LWLockRelease(CheckpointLock);
return false;
}
ControlFile->checkPoint = lastCheckPointRecPtr;
ControlFile->checkPointCopy = lastCheckPoint;
ControlFile->time = (pg_time_t) time(NULL);
+ if (flags & CHECKPOINT_IS_SHUTDOWN)
+ ControlFile->state = DB_SHUTDOWNED_IN_RECOVERY;
UpdateControlFile();
}
LWLockRelease(ControlFileLock);
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
* licence: BSD
*
- * $PostgreSQL: pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.49 2010/04/28 19:38:49 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.50 2010/06/03 03:20:00 rhaas Exp $
*/
/*
return _("starting up");
case DB_SHUTDOWNED:
return _("shut down");
+ case DB_SHUTDOWNED_IN_RECOVERY:
+ return _("shut down in recovery");
case DB_SHUTDOWNING:
return _("shutting down");
case DB_IN_CRASH_RECOVERY:
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.54 2010/04/28 16:10:43 heikki Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.55 2010/06/03 03:20:00 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
{
DB_STARTUP = 0,
DB_SHUTDOWNED,
+ DB_SHUTDOWNED_IN_RECOVERY,
DB_SHUTDOWNING,
DB_IN_CRASH_RECOVERY,
DB_IN_ARCHIVE_RECOVERY,