aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/vacuumlazy.c
diff options
context:
space:
mode:
authorKevin Grittner <kgrittn@postgresql.org>2016-04-08 14:30:10 -0500
committerKevin Grittner <kgrittn@postgresql.org>2016-04-08 14:30:10 -0500
commit8b65cf4c5edabdcae45ceaef7b9ac236879aae50 (patch)
treef4412d3e9bc0db823ac32e08fac8e3124b42ff02 /src/backend/commands/vacuumlazy.c
parent689f9a058854a1a32e994818dd6d79f49d8f8a1b (diff)
downloadpostgresql-8b65cf4c5edabdcae45ceaef7b9ac236879aae50.tar.gz
postgresql-8b65cf4c5edabdcae45ceaef7b9ac236879aae50.zip
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.
Diffstat (limited to 'src/backend/commands/vacuumlazy.c')
-rw-r--r--src/backend/commands/vacuumlazy.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c
index 52e19b30614..3f48ef40701 100644
--- a/src/backend/commands/vacuumlazy.c
+++ b/src/backend/commands/vacuumlazy.c
@@ -803,7 +803,7 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
vacrelstats->scanned_pages++;
- page = BufferGetPage(buf);
+ page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
if (PageIsNew(page))
{
@@ -1378,7 +1378,7 @@ lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats)
&vmbuffer);
/* Now that we've compacted the page, record its available space */
- page = BufferGetPage(buf);
+ page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
freespace = PageGetHeapFreeSpace(page);
UnlockReleaseBuffer(buf);
@@ -1414,7 +1414,7 @@ static int
lazy_vacuum_page(Relation onerel, BlockNumber blkno, Buffer buffer,
int tupindex, LVRelStats *vacrelstats, Buffer *vmbuffer)
{
- Page page = BufferGetPage(buffer);
+ Page page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
OffsetNumber unused[MaxOffsetNumber];
int uncnt = 0;
TransactionId visibility_cutoff_xid;
@@ -1511,7 +1511,7 @@ lazy_vacuum_page(Relation onerel, BlockNumber blkno, Buffer buffer,
static bool
lazy_check_needs_freeze(Buffer buf, bool *hastup)
{
- Page page = BufferGetPage(buf);
+ Page page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
OffsetNumber offnum,
maxoff;
HeapTupleHeader tupleheader;
@@ -1863,7 +1863,7 @@ count_nondeletable_pages(Relation onerel, LVRelStats *vacrelstats)
/* In this phase we only need shared access to the buffer */
LockBuffer(buf, BUFFER_LOCK_SHARE);
- page = BufferGetPage(buf);
+ page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
if (PageIsNew(page) || PageIsEmpty(page))
{
@@ -2031,7 +2031,7 @@ heap_page_is_all_visible(Relation rel, Buffer buf,
TransactionId *visibility_cutoff_xid,
bool *all_frozen)
{
- Page page = BufferGetPage(buf);
+ Page page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
BlockNumber blockno = BufferGetBlockNumber(buf);
OffsetNumber offnum,
maxoff;