1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

Make the world safe for full_page_writes. Allow XLOG records that try to

update no-longer-existing pages to fall through as no-ops, but make a note
of each page number referenced by such records.  If we don't see a later
XLOG entry dropping the table or truncating away the page, complain at
the end of XLOG replay.  Since this fixes the known failure mode for
full_page_writes = off, revert my previous band-aid patch that disabled
that GUC variable.
This commit is contained in:
Tom Lane
2006-04-14 20:27:24 +00:00
parent 0fcc3c2f1d
commit defe93463c
4 changed files with 226 additions and 22 deletions

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.234 2006/04/05 03:34:05 tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.235 2006/04/14 20:27:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -980,7 +980,8 @@ XLogCheckBuffer(XLogRecData *rdata,
*/
*lsn = page->pd_lsn;
if (XLByteLE(page->pd_lsn, RedoRecPtr))
if (fullPageWrites &&
XLByteLE(page->pd_lsn, RedoRecPtr))
{
/*
* The page needs to be backed up, so set up *bkpb
@ -4786,6 +4787,12 @@ StartupXLOG(void)
RmgrTable[rmid].rm_cleanup();
}
/*
* Check to see if the XLOG sequence contained any unresolved
* references to uninitialized pages.
*/
XLogCheckInvalidPages();
/*
* Reset pgstat data, because it may be invalid after recovery.
*/