Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 31f00d1

Browse files
Move system startup message prior to any calls out of data directory.
This allows us to see what mode the server is in before it starts to perform actions that can block or hang. Otherwise server messages may not appear until after messages that say FATAL the database server is starting up.
1 parent 001b1ad commit 31f00d1

File tree

1 file changed

+19
-17
lines changed
  • src/backend/access/transam

1 file changed

+19
-17
lines changed

src/backend/access/transam/xlog.c

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.386 2010/04/01 00:43:29 rhaas Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.387 2010/04/02 13:10:56 sriggs Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -5557,6 +5557,24 @@ StartupXLOG(void)
55575557
restartPointCommand ? restartPointCommand : "",
55585558
sizeof(XLogCtl->restartPointCommand));
55595559

5560+
if (InArchiveRecovery)
5561+
{
5562+
if (StandbyMode)
5563+
ereport(LOG,
5564+
(errmsg("entering standby mode")));
5565+
else if (recoveryTarget == RECOVERY_TARGET_XID)
5566+
ereport(LOG,
5567+
(errmsg("starting point-in-time recovery to XID %u",
5568+
recoveryTargetXid)));
5569+
else if (recoveryTarget == RECOVERY_TARGET_TIME)
5570+
ereport(LOG,
5571+
(errmsg("starting point-in-time recovery to %s",
5572+
timestamptz_to_str(recoveryTargetTime))));
5573+
else
5574+
ereport(LOG,
5575+
(errmsg("starting archive recovery")));
5576+
}
5577+
55605578
if (read_backup_label(&checkPointLoc))
55615579
{
55625580
/*
@@ -5694,23 +5712,7 @@ StartupXLOG(void)
56945712
* backup history file.
56955713
*/
56965714
if (InArchiveRecovery)
5697-
{
5698-
if (StandbyMode)
5699-
ereport(LOG,
5700-
(errmsg("entering standby mode")));
5701-
else if (recoveryTarget == RECOVERY_TARGET_XID)
5702-
ereport(LOG,
5703-
(errmsg("starting point-in-time recovery to XID %u",
5704-
recoveryTargetXid)));
5705-
else if (recoveryTarget == RECOVERY_TARGET_TIME)
5706-
ereport(LOG,
5707-
(errmsg("starting point-in-time recovery to %s",
5708-
timestamptz_to_str(recoveryTargetTime))));
5709-
else
5710-
ereport(LOG,
5711-
(errmsg("starting archive recovery")));
57125715
ControlFile->state = DB_IN_ARCHIVE_RECOVERY;
5713-
}
57145716
else
57155717
{
57165718
ereport(LOG,

0 commit comments

Comments
 (0)