You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Revert the patch to check if we've reached end-of-backup also when doing
crash recovery, and throw an error if not. hubert depesz lubaczewski pointed
out that that situation also happens in the crash recovery following a
system crash that happens during an online backup.
We might want to do something smarter in 9.1, like put the check back for
backups taken with pg_basebackup, but that's for another patch.
if (reachedStopPoint) /* stopped because of stop request */
6654
+
if (reachedStopPoint)
6655
+
{
6656
+
/* stopped because of stop request */
6655
6657
ereport(FATAL,
6656
6658
(errmsg("requested recovery stop point is before consistent recovery point")));
6657
-
/* ran off end of WAL */
6658
-
if (!XLogRecPtrIsInvalid(ControlFile->backupStartPoint))
6659
-
ereport(FATAL,
6660
-
(errmsg("WAL ends before end of online backup"),
6661
-
errhint("Online backup started with pg_start_backup() must be ended with pg_stop_backup(), and all WAL up to that point must be available at recovery.")));
6662
-
else
6663
-
ereport(FATAL,
6664
-
(errmsg("WAL ends before consistent recovery point")));
6659
+
}
6660
+
/*
6661
+
* Ran off end of WAL before reaching end-of-backup WAL record,
6662
+
* or minRecoveryPoint. That's usually a bad sign, indicating that
6663
+
* you tried to recover from an online backup but never called
6664
+
* pg_stop_backup(), or you didn't archive all the WAL up to that
6665
+
* point. However, this also happens in crash recovery, if the
6666
+
* system crashes while an online backup is in progress. We
6667
+
* must not treat that as an error, or the database will refuse
6668
+
* to start up.
6669
+
*/
6670
+
if (InArchiveRecovery)
6671
+
{
6672
+
if (!XLogRecPtrIsInvalid(ControlFile->backupStartPoint))
6673
+
ereport(FATAL,
6674
+
(errmsg("WAL ends before end of online backup"),
6675
+
errhint("Online backup started with pg_start_backup() must be ended with pg_stop_backup(), and all WAL up to that point must be available at recovery.")));
6676
+
else
6677
+
ereport(FATAL,
6678
+
(errmsg("WAL ends before consistent recovery point")));
0 commit comments