git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64e5a85)
Force zero_damaged_pages to be effectively ON during recovery from WAL,
Mon, 1 Dec 2003 16:53:19 +0000 (16:53 +0000)
Mon, 1 Dec 2003 16:53:19 +0000 (16:53 +0000)
since there is no need to worry about damaged pages when we are going to
overwrite them anyway from the WAL. Per recent discussion.


diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index e363180d6615b0851e3e68bf7056f888b9cbab15..c0c35613208e7a7248659d7a2cd71df3ff180c7c 100644 (file)
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.147 2003年11月29日 19:51:56 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.148 2003年12月01日 16:53:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -231,7 +231,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),
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /