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

Commit a2239b9

Browse files
committed
Make pg_stop_backup's reporting a bit more verbose in hopes of making
error cases less intimidating for novices. Per discussion. Greg Smith
1 parent 29d2f86 commit a2239b9

File tree

1 file changed

+11
-4
lines changed
  • src/backend/access/transam

1 file changed

+11
-4
lines changed

src/backend/access/transam/xlog.c

Lines changed: 11 additions & 4 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.377 2010/02/19 10:51:03 heikki Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.378 2010/02/25 02:17:50 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -8132,7 +8132,8 @@ pg_stop_backup(PG_FUNCTION_ARGS)
81328132
*
81338133
* We wait forever, since archive_command is supposed to work and we
81348134
* assume the admin wanted his backup to work completely. If you don't
8135-
* wish to wait, you can set statement_timeout.
8135+
* wish to wait, you can set statement_timeout. Also, some notices
8136+
* are issued to clue in anyone who might be doing this interactively.
81368137
*/
81378138
XLByteToPrevSeg(stoppoint, _logId, _logSeg);
81388139
XLogFileName(lastxlogfilename, ThisTimeLineID, _logId, _logSeg);
@@ -8141,6 +8142,9 @@ pg_stop_backup(PG_FUNCTION_ARGS)
81418142
BackupHistoryFileName(histfilename, ThisTimeLineID, _logId, _logSeg,
81428143
startpoint.xrecoff % XLogSegSize);
81438144

8145+
ereport(NOTICE,
8146+
(errmsg("pg_stop_backup cleanup done, waiting for required WAL segments to be archived")));
8147+
81448148
seconds_before_warning = 60;
81458149
waits = 0;
81468150

@@ -8155,8 +8159,11 @@ pg_stop_backup(PG_FUNCTION_ARGS)
81558159
{
81568160
seconds_before_warning *= 2; /* This wraps in >10 years... */
81578161
ereport(WARNING,
8158-
(errmsg("pg_stop_backup still waiting for archive to complete (%d seconds elapsed)",
8159-
waits)));
8162+
(errmsg("pg_stop_backup still waiting for all required WAL segments to be archived (%d seconds elapsed)",
8163+
waits),
8164+
errhint("Check that your archive_command is executing properly. "
8165+
"pg_stop_backup can be cancelled safely, "
8166+
"but the database backup will not be usable without all the WAL segments.")));
81608167
}
81618168
}
81628169

0 commit comments

Comments
 (0)