Skip to content

Commit e465390

Browse files
committed
Reduce the chatter to the log when starting a standby server. Don't
echo all the recovery.conf options. Don't emit the "initializing recovery connections" message, which doesn't mean anything to a user. Remove the "starting archive recovery" message and replace the "automatic recovery in progress" message with a more informative message saying whether the server is doing PITR, normal archive recovery, or standby mode.
1 parent 1026be1 commit e465390

File tree

1 file changed

+30
-18
lines changed
  • src/backend/access/transam

1 file changed

+30
-18
lines changed

src/backend/access/transam/xlog.c

Lines changed: 30 additions & 18 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.372 2010/02/12 07:56:36 heikki Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.373 2010/02/12 09:49:08 heikki Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -4882,9 +4882,6 @@ readRecoveryCommandFile(void)
48824882
RECOVERY_COMMAND_FILE)));
48834883
}
48844884

4885-
ereport(LOG,
4886-
(errmsg("starting archive recovery")));
4887-
48884885
/*
48894886
* Parse the file...
48904887
*/
@@ -4927,14 +4924,14 @@ readRecoveryCommandFile(void)
49274924
if (strcmp(tok1, "restore_command") == 0)
49284925
{
49294926
recoveryRestoreCommand = pstrdup(tok2);
4930-
ereport(LOG,
4927+
ereport(DEBUG2,
49314928
(errmsg("restore_command = '%s'",
49324929
recoveryRestoreCommand)));
49334930
}
49344931
else if (strcmp(tok1, "recovery_end_command") == 0)
49354932
{
49364933
recoveryEndCommand = pstrdup(tok2);
4937-
ereport(LOG,
4934+
ereport(DEBUG2,
49384935
(errmsg("recovery_end_command = '%s'",
49394936
recoveryEndCommand)));
49404937
}
@@ -4953,10 +4950,10 @@ readRecoveryCommandFile(void)
49534950
tok2)));
49544951
}
49554952
if (rtli)
4956-
ereport(LOG,
4953+
ereport(DEBUG2,
49574954
(errmsg("recovery_target_timeline = %u", rtli)));
49584955
else
4959-
ereport(LOG,
4956+
ereport(DEBUG2,
49604957
(errmsg("recovery_target_timeline = latest")));
49614958
}
49624959
else if (strcmp(tok1, "recovery_target_xid") == 0)
@@ -4967,7 +4964,7 @@ readRecoveryCommandFile(void)
49674964
ereport(FATAL,
49684965
(errmsg("recovery_target_xid is not a valid number: \"%s\"",
49694966
tok2)));
4970-
ereport(LOG,
4967+
ereport(DEBUG2,
49714968
(errmsg("recovery_target_xid = %u",
49724969
recoveryTargetXid)));
49734970
recoveryTarget = true;
@@ -4992,7 +4989,7 @@ readRecoveryCommandFile(void)
49924989
CStringGetDatum(tok2),
49934990
ObjectIdGetDatum(InvalidOid),
49944991
Int32GetDatum(-1)));
4995-
ereport(LOG,
4992+
ereport(DEBUG2,
49964993
(errmsg("recovery_target_time = '%s'",
49974994
timestamptz_to_str(recoveryTargetTime))));
49984995
}
@@ -5005,7 +5002,7 @@ readRecoveryCommandFile(void)
50055002
ereport(ERROR,
50065003
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
50075004
errmsg("parameter \"recovery_target_inclusive\" requires a Boolean value")));
5008-
ereport(LOG,
5005+
ereport(DEBUG2,
50095006
(errmsg("recovery_target_inclusive = %s", tok2)));
50105007
}
50115008
else if (strcmp(tok1, "standby_mode") == 0)
@@ -5014,20 +5011,20 @@ readRecoveryCommandFile(void)
50145011
ereport(ERROR,
50155012
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
50165013
errmsg("parameter \"standby_mode\" requires a Boolean value")));
5017-
ereport(LOG,
5014+
ereport(DEBUG2,
50185015
(errmsg("standby_mode = '%s'", tok2)));
50195016
}
50205017
else if (strcmp(tok1, "primary_conninfo") == 0)
50215018
{
50225019
PrimaryConnInfo = pstrdup(tok2);
5023-
ereport(LOG,
5020+
ereport(DEBUG2,
50245021
(errmsg("primary_conninfo = '%s'",
50255022
PrimaryConnInfo)));
50265023
}
50275024
else if (strcmp(tok1, "trigger_file") == 0)
50285025
{
50295026
TriggerFile = pstrdup(tok2);
5030-
ereport(LOG,
5027+
ereport(DEBUG2,
50315028
(errmsg("trigger_file = '%s'",
50325029
TriggerFile)));
50335030
}
@@ -5649,8 +5646,23 @@ StartupXLOG(void)
56495646
*/
56505647
if (InArchiveRecovery)
56515648
{
5652-
ereport(LOG,
5653-
(errmsg("automatic recovery in progress")));
5649+
if (StandbyMode)
5650+
ereport(LOG,
5651+
(errmsg("entering standby mode")));
5652+
else if (recoveryTarget)
5653+
{
5654+
if (recoveryTargetExact)
5655+
ereport(LOG,
5656+
(errmsg("starting point-in-time recovery to XID %u",
5657+
recoveryTargetXid)));
5658+
else
5659+
ereport(LOG,
5660+
(errmsg("starting point-in-time recovery to %s",
5661+
timestamptz_to_str(recoveryTargetTime))));
5662+
}
5663+
else
5664+
ereport(LOG,
5665+
(errmsg("starting archive recovery")));
56545666
ControlFile->state = DB_IN_ARCHIVE_RECOVERY;
56555667
}
56565668
else
@@ -5718,8 +5730,8 @@ StartupXLOG(void)
57185730

57195731
CheckRequiredParameterValues(checkPoint);
57205732

5721-
ereport(LOG,
5722-
(errmsg("initializing recovery connections")));
5733+
ereport(DEBUG1,
5734+
(errmsg("initializing recovery connections")));
57235735

57245736
InitRecoveryTransactionEnvironment();
57255737

0 commit comments

Comments
 (0)