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 */
81378138XLByteToPrevSeg (stoppoint ,_logId ,_logSeg );
81388139XLogFileName (lastxlogfilename ,ThisTimeLineID ,_logId ,_logSeg );
@@ -8141,6 +8142,9 @@ pg_stop_backup(PG_FUNCTION_ARGS)
81418142BackupHistoryFileName (histfilename ,ThisTimeLineID ,_logId ,_logSeg ,
81428143startpoint .xrecoff %XLogSegSize );
81438144
8145+ ereport (NOTICE ,
8146+ (errmsg ("pg_stop_backup cleanup done, waiting for required WAL segments to be archived" )));
8147+
81448148seconds_before_warning = 60 ;
81458149waits = 0 ;
81468150
@@ -8155,8 +8159,11 @@ pg_stop_backup(PG_FUNCTION_ARGS)
81558159{
81568160seconds_before_warning *=2 ;/* This wraps in >10 years... */
81578161ereport (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