Skip to content

Commit 0902ece

Browse files
committed
Force zero_damaged_pages to be effectively ON during recovery from WAL,
since there is no need to worry about damaged pages when we are going to overwrite them anyway from the WAL. Per recent discussion.
1 parent 64e5a85 commit 0902ece

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.147 2003/11/29 19:51:56 pgsql Exp $
11+
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.148 2003/12/01 16:53:19 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -231,7 +231,13 @@ ReadBufferInternal(Relation reln, BlockNumber blockNum,
231231
if (status == SM_SUCCESS &&
232232
!PageHeaderIsValid((PageHeader) MAKE_PTR(bufHdr->data)))
233233
{
234-
if (zero_damaged_pages)
234+
/*
235+
* During WAL recovery, the first access to any data page should
236+
* overwrite the whole page from the WAL; so a clobbered page
237+
* header is not reason to fail. Hence, when InRecovery we may
238+
* always act as though zero_damaged_pages is ON.
239+
*/
240+
if (zero_damaged_pages || InRecovery)
235241
{
236242
ereport(WARNING,
237243
(errcode(ERRCODE_DATA_CORRUPTED),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy