* If we launched a WAL receiver, it should be gone by now. It will trump
6615
* over the startup checkpoint and subsequent records if it's still alive,
6616
* so be extra sure that it's gone.
6614
* Kill WAL receiver, if it's still running, before we continue to write
6615
* the startup checkpoint record. It will trump over the checkpoint and
6616
* subsequent records if it's still alive when we start writing WAL.
6617
6617
*/
6618
if (WalRcvInProgress())
6619
elog(PANIC, "wal receiver still active");
6618
ShutdownWalRcv();
6620
6619
6621
6620
/*
6622
6621
* We don't need the latch anymore. It's not strictly necessary to disown
6657
6656
ereport(FATAL,
6658
6657
(errmsg("requested recovery stop point is before consistent recovery point")));
6659
6658
}
6659
6660
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
6661
* Ran off end of WAL before reaching end-of-backup WAL record, or
6662
* minRecoveryPoint. That's usually a bad sign, indicating that you
6663
* tried to recover from an online backup but never called
6664
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.
6665
* point. However, this also happens in crash recovery, if the system
6666
* crashes while an online backup is in progress. We must not treat
6667
* that as an error, or the database will refuse to start up.
6669
6668
*/
6670
6669
if (InArchiveRecovery)
6671
6670
{
6675
6674
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
6675
else
6677
6676
ereport(FATAL,
6678
(errmsg("WAL ends before consistent recovery point")));
6677
(errmsg("WAL ends before consistent recovery point")));