diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-12-01 16:53:30 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-12-01 16:53:30 +0000 |
commit | 090bdcb3177bf5a8dc7155058de82e739e272bf3 (patch) | |
tree | 2bb8f52652fa046e5fc6a9a606d52e83fb5f37d0 /src | |
parent | 10b84be9b347bb6ab587719301bbb72ea5f5c78a (diff) | |
download | postgresql-090bdcb3177bf5a8dc7155058de82e739e272bf3.tar.gz postgresql-090bdcb3177bf5a8dc7155058de82e739e272bf3.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/buffer/bufmgr.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index d95129df4e2..3fa2ffe4aa5 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.141 2003/09/25 06:58:01 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.141.2.1 2003/12/01 16:53:30 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -227,7 +227,13 @@ ReadBufferInternal(Relation reln, BlockNumber blockNum, 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) { ereport(WARNING, (errcode(ERRCODE_DATA_CORRUPTED), |