Check if we've reached end-of-backup point also if no redo is required.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 19 Dec 2012 12:13:23 +0000 (14:13 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 19 Dec 2012 12:22:00 +0000 (14:22 +0200)
commite43f947bf32f3ea4caa5b895ca7c7659b17192ae
tree66f8a5f7186be06f9623d8e191b7c8894606dfa9
parentf2b88080db43fbadaef990a1b240bd634d1d4275
Check if we've reached end-of-backup point also if no redo is required.

If you restored from a backup taken from a standby, and the last record in
the backup is the checkpoint record, ie. there is no redo required except
for the checkpoint record, we would fail to notice that we've reached the
end-of-backup point, and the database is consistent. The result was an
error "WAL ends before end of online backup". To fix, move the
have-we-reached-end-of-backup check into CheckRecoveryConsistency(), which
is already responsible for similar checks with minRecoveryPoint, and is
called in the right places.

Backpatch to 9.2, this check and bug did not exist before that.
src/backend/access/transam/xlog.c