*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.133.2.1 2003/04/04 00:32:57 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.133.2.2 2003/12/01 16:53:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
if (status == SM_SUCCESS &&
!PageHeaderIsValid((PageHeader) MAKE_PTR(bufHdr->data)))
{
- if (zero_damaged_pages)
+ /*
+ * During WAL recovery, the first access to any data page should
+ * overwrite the whole page from the WAL; so a clobbered page
+ * header is not reason to fail. Hence, when InRecovery we may
+ * always act as though zero_damaged_pages is ON.
+ */
+ if (zero_damaged_pages || InRecovery)
{
elog(WARNING, "Invalid page header in block %u of %s; zeroing out page",
blockNum, RelationGetRelationName(reln));