1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-14 02:22:38 +03:00

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.
This commit is contained in:
Kevin Grittner
2016-04-08 14:30:10 -05:00
parent 689f9a0588
commit 8b65cf4c5e
65 changed files with 735 additions and 522 deletions

View File

@@ -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;