stop-backup-warning.diff

text/x-patch

Filename: stop-backup-warning.diff
Type: text/x-patch
Part: 0
Message: Re: pg_stop_backup does not complete

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/access/transam/xlog.c 7 2
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index ca088b0..c09ede9 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -8125,6 +8125,9 @@ pg_stop_backup(PG_FUNCTION_ARGS)
 	BackupHistoryFileName(histfilename, ThisTimeLineID, _logId, _logSeg,
 						  startpoint.xrecoff % XLogSegSize);
 
+	ereport(NOTICE,
+			(errmsg("pg_stop_backup cleanup done, waiting for required segments to archive")));
+
 	seconds_before_warning = 60;
 	waits = 0;
 
@@ -8139,8 +8142,10 @@ pg_stop_backup(PG_FUNCTION_ARGS)
 		{
 			seconds_before_warning *= 2;		/* This wraps in >10 years... */
 			ereport(WARNING,
-					(errmsg("pg_stop_backup still waiting for archive to complete (%d seconds elapsed)",
-							waits)));
+					(errmsg("pg_stop_backup still waiting for all required segments to archive (%d seconds elapsed)",
+							waits),
+				 	 errhint("Confirm your archive_command is executing successfully.  "
+							 "pg_stop_backup can be aborted safely, but the resulting backup will not be usable.")));
 		}
 	}