mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
Make pg_stop_backup's reporting a bit more verbose in hopes of making
error cases less intimidating for novices. Per discussion. Greg Smith
This commit is contained in:
parent
29d2f86a31
commit
a2239b96e0
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.377 2010/02/19 10:51:03 heikki Exp $
|
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.378 2010/02/25 02:17:50 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -8132,7 +8132,8 @@ pg_stop_backup(PG_FUNCTION_ARGS)
|
|||||||
*
|
*
|
||||||
* We wait forever, since archive_command is supposed to work and we
|
* We wait forever, since archive_command is supposed to work and we
|
||||||
* assume the admin wanted his backup to work completely. If you don't
|
* assume the admin wanted his backup to work completely. If you don't
|
||||||
* wish to wait, you can set statement_timeout.
|
* wish to wait, you can set statement_timeout. Also, some notices
|
||||||
|
* are issued to clue in anyone who might be doing this interactively.
|
||||||
*/
|
*/
|
||||||
XLByteToPrevSeg(stoppoint, _logId, _logSeg);
|
XLByteToPrevSeg(stoppoint, _logId, _logSeg);
|
||||||
XLogFileName(lastxlogfilename, ThisTimeLineID, _logId, _logSeg);
|
XLogFileName(lastxlogfilename, ThisTimeLineID, _logId, _logSeg);
|
||||||
@ -8141,6 +8142,9 @@ pg_stop_backup(PG_FUNCTION_ARGS)
|
|||||||
BackupHistoryFileName(histfilename, ThisTimeLineID, _logId, _logSeg,
|
BackupHistoryFileName(histfilename, ThisTimeLineID, _logId, _logSeg,
|
||||||
startpoint.xrecoff % XLogSegSize);
|
startpoint.xrecoff % XLogSegSize);
|
||||||
|
|
||||||
|
ereport(NOTICE,
|
||||||
|
(errmsg("pg_stop_backup cleanup done, waiting for required WAL segments to be archived")));
|
||||||
|
|
||||||
seconds_before_warning = 60;
|
seconds_before_warning = 60;
|
||||||
waits = 0;
|
waits = 0;
|
||||||
|
|
||||||
@ -8155,8 +8159,11 @@ pg_stop_backup(PG_FUNCTION_ARGS)
|
|||||||
{
|
{
|
||||||
seconds_before_warning *= 2; /* This wraps in >10 years... */
|
seconds_before_warning *= 2; /* This wraps in >10 years... */
|
||||||
ereport(WARNING,
|
ereport(WARNING,
|
||||||
(errmsg("pg_stop_backup still waiting for archive to complete (%d seconds elapsed)",
|
(errmsg("pg_stop_backup still waiting for all required WAL segments to be archived (%d seconds elapsed)",
|
||||||
waits)));
|
waits),
|
||||||
|
errhint("Check that your archive_command is executing properly. "
|
||||||
|
"pg_stop_backup can be cancelled safely, "
|
||||||
|
"but the database backup will not be usable without all the WAL segments.")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user