In the checkpoint written at the end of archive recovery, the WAL page header
authorHeikki Linnakangas <heikki@enterprisedb.com>
Thu, 27 Aug 2009 07:15:41 +0000 (07:15 +0000)
committerHeikki Linnakangas <heikki@enterprisedb.com>
Thu, 27 Aug 2009 07:15:41 +0000 (07:15 +0000)
commitcd2504faf6234276412d87e67d3b0088e57d59e9
tree625deb51758b8c4b621b5e340ba55267c3791bf4
parent1d06de7d405784779b78fbc1cc65b470d92abf53
In the checkpoint written at the end of archive recovery, the WAL page header
was incorrectly initialized with timeline ID 0. That rendered the WAL page
unrecoverable, making a subsequent archive recovery stop at that point.
ThisTimeLineID needs to be initialized before calling AdvanceXLInsertBuffer().

This fixes bug #5011 reported by James Bardin. Backpatch to 8.4, as the bug
was introduced by the changes to use of bgwriter for writing the
end-of-archive-recovery checkpoint. Patch by Tom Lane.
src/backend/access/transam/xlog.c