7
7
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
8
8
* Portions Copyright (c) 1994, Regents of the University of California
9
9
*
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 $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -8132,7 +8132,8 @@ pg_stop_backup(PG_FUNCTION_ARGS)
8132
8132
*
8133
8133
* We wait forever, since archive_command is supposed to work and we
8134
8134
* 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.
8136
8137
*/
8137
8138
XLByteToPrevSeg (stoppoint , _logId , _logSeg );
8138
8139
XLogFileName (lastxlogfilename , ThisTimeLineID , _logId , _logSeg );
@@ -8141,6 +8142,9 @@ pg_stop_backup(PG_FUNCTION_ARGS)
8141
8142
BackupHistoryFileName (histfilename , ThisTimeLineID , _logId , _logSeg ,
8142
8143
startpoint .xrecoff % XLogSegSize );
8143
8144
8145
+ ereport (NOTICE ,
8146
+ (errmsg ("pg_stop_backup cleanup done, waiting for required WAL segments to be archived" )));
8147
+
8144
8148
seconds_before_warning = 60 ;
8145
8149
waits = 0 ;
8146
8150
@@ -8155,8 +8159,11 @@ pg_stop_backup(PG_FUNCTION_ARGS)
8155
8159
{
8156
8160
seconds_before_warning *= 2 ; /* This wraps in >10 years... */
8157
8161
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." )));
8160
8167
}
8161
8168
}
8162
8169
0 commit comments