From 8b65cf4c5edabdcae45ceaef7b9ac236879aae50 Mon Sep 17 00:00:00 2001 From: Kevin Grittner Date: Fri, 8 Apr 2016 14:30:10 -0500 Subject: Modify BufferGetPage() to prepare for "snapshot too old" feature This patch is a no-op patch which is intended to reduce the chances of failures of omission once the functional part of the "snapshot too old" patch goes in. It adds parameters for snapshot, relation, and an enum to specify whether the snapshot age check needs to be done for the page at this point. This initial patch passes NULL for the first two new parameters and BGP_NO_SNAPSHOT_TEST for the third. The follow-on patch will change the places where the test needs to be made. --- src/backend/access/transam/xlogutils.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/backend/access/transam/xlogutils.c') diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c index f6ca2b95e51..c3213ac0b6f 100644 --- a/src/backend/access/transam/xlogutils.c +++ b/src/backend/access/transam/xlogutils.c @@ -358,7 +358,7 @@ XLogReadBufferForRedoExtended(XLogReaderState *record, { *buf = XLogReadBufferExtended(rnode, forknum, blkno, get_cleanup_lock ? RBM_ZERO_AND_CLEANUP_LOCK : RBM_ZERO_AND_LOCK); - page = BufferGetPage(*buf); + page = BufferGetPage(*buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); if (!RestoreBlockImage(record, block_id, page)) elog(ERROR, "failed to restore block image"); @@ -396,7 +396,8 @@ XLogReadBufferForRedoExtended(XLogReaderState *record, else LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); } - if (lsn <= PageGetLSN(BufferGetPage(*buf))) + if (lsn <= PageGetLSN(BufferGetPage(*buf, NULL, NULL, + BGP_NO_SNAPSHOT_TEST))) return BLK_DONE; else return BLK_NEEDS_REDO; @@ -502,7 +503,8 @@ XLogReadBufferExtended(RelFileNode rnode, ForkNumber forknum, if (mode == RBM_NORMAL) { /* check that page has been initialized */ - Page page = (Page) BufferGetPage(buffer); + Page page = BufferGetPage(buffer, NULL, NULL, + BGP_NO_SNAPSHOT_TEST); /* * We assume that PageIsNew is safe without a lock. During recovery, -- cgit v1.2.3