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/heap/pruneheap.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/backend/access/heap/pruneheap.c') diff --git a/src/backend/access/heap/pruneheap.c b/src/backend/access/heap/pruneheap.c index 59beadda9d1..19201b0bca5 100644 --- a/src/backend/access/heap/pruneheap.c +++ b/src/backend/access/heap/pruneheap.c @@ -74,7 +74,7 @@ static void heap_prune_record_unused(PruneState *prstate, OffsetNumber offnum); void heap_page_prune_opt(Relation relation, Buffer buffer) { - Page page = BufferGetPage(buffer); + Page page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST); Size minfree; TransactionId OldestXmin; @@ -174,7 +174,7 @@ heap_page_prune(Relation relation, Buffer buffer, TransactionId OldestXmin, bool report_stats, TransactionId *latestRemovedXid) { int ndeleted = 0; - Page page = BufferGetPage(buffer); + Page page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST); OffsetNumber offnum, maxoff; PruneState prstate; @@ -261,7 +261,8 @@ heap_page_prune(Relation relation, Buffer buffer, TransactionId OldestXmin, prstate.nowunused, prstate.nunused, prstate.latestRemovedXid); - PageSetLSN(BufferGetPage(buffer), recptr); + PageSetLSN(BufferGetPage(buffer, NULL, NULL, + BGP_NO_SNAPSHOT_TEST), recptr); } } else @@ -347,7 +348,7 @@ heap_prune_chain(Relation relation, Buffer buffer, OffsetNumber rootoffnum, PruneState *prstate) { int ndeleted = 0; - Page dp = (Page) BufferGetPage(buffer); + Page dp = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST); TransactionId priorXmax = InvalidTransactionId; ItemId rootlp; HeapTupleHeader htup; @@ -673,7 +674,8 @@ heap_page_prune_execute(Buffer buffer, OffsetNumber *nowdead, int ndead, OffsetNumber *nowunused, int nunused) { - Page page = (Page) BufferGetPage(buffer); + Page page = BufferGetPage(buffer, NULL, NULL, + BGP_NO_SNAPSHOT_TEST); OffsetNumber *offnum; int i; -- cgit v1.2.3