mirror of
https://github.com/postgres/postgres.git
synced 2025-08-24 09:27:52 +03:00
During WAL recovery, when reading a page that we intend to overwrite completely
from the WAL data, don't bother to physically read it; just have bufmgr.c return a zeroed-out buffer instead. This speeds recovery significantly, and also avoids unnecessary failures when a page-to-be-overwritten has corrupt page headers on disk. This replaces a former kluge that accomplished the latter by pretending zero_damaged_pages was always ON during WAL recovery; which was OK when the kluge was put in, but is unsafe when restoring a WAL log that was written with full_page_writes off. Heikki Linnakangas
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.102 2007/01/05 22:19:57 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.103 2007/05/02 23:18:03 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -111,6 +111,7 @@ extern DLLIMPORT int32 *LocalRefCount;
|
||||
* prototypes for functions in bufmgr.c
|
||||
*/
|
||||
extern Buffer ReadBuffer(Relation reln, BlockNumber blockNum);
|
||||
extern Buffer ReadOrZeroBuffer(Relation reln, BlockNumber blockNum);
|
||||
extern void ReleaseBuffer(Buffer buffer);
|
||||
extern void UnlockReleaseBuffer(Buffer buffer);
|
||||
extern void MarkBufferDirty(Buffer buffer);
|
||||
|
Reference in New Issue
Block a user