]> granicus.if.org Git - postgresql/commit
If backup-end record is not seen, and we reach end of recovery from a
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 10 Aug 2011 06:16:29 +0000 (09:16 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 10 Aug 2011 06:22:49 +0000 (09:22 +0300)
commit41f9ffd928b6fdcedd685483e777b0fa71ece47c
treea5fb89c11e0df78c5cff40b4ec7bbcc76b8841e5
parent9f17ffd8660243382809b8023ff3d38fbfac4e8b
If backup-end record is not seen, and we reach end of recovery from a
streamed backup, throw an error and refuse to start up. The restore has not
finished correctly in that case and the data directory is possibly corrupt.
We already errored out in case of archive recovery, but could not during
crash recovery because we couldn't distinguish between the case that
pg_start_backup() was called and the database then crashed (must not error,
data is OK), and the case that we're restoring from a backup and not all
the needed WAL was replayed (data can be corrupt).

To distinguish those cases, add a line to backup_label to indicate
whether the backup was taken with pg_start/stop_backup(), or by streaming
(ie. pg_basebackup).

This requires re-initdb, because of a new field added to the control file.
src/backend/access/transam/xlog.c
src/include/catalog/pg_control.h