1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +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

@@ -125,7 +125,8 @@ static void
vacuumLeafPage(spgBulkDeleteState *bds, Relation index, Buffer buffer,
bool forPending)
{
Page page = BufferGetPage(buffer);
Page page = BufferGetPage(buffer, NULL, NULL,
BGP_NO_SNAPSHOT_TEST);
spgxlogVacuumLeaf xlrec;
OffsetNumber toDead[MaxIndexTuplesPerPage];
OffsetNumber toPlaceholder[MaxIndexTuplesPerPage];
@@ -405,7 +406,8 @@ vacuumLeafPage(spgBulkDeleteState *bds, Relation index, Buffer buffer,
static void
vacuumLeafRoot(spgBulkDeleteState *bds, Relation index, Buffer buffer)
{
Page page = BufferGetPage(buffer);
Page page = BufferGetPage(buffer, NULL, NULL,
BGP_NO_SNAPSHOT_TEST);
spgxlogVacuumRoot xlrec;
OffsetNumber toDelete[MaxIndexTuplesPerPage];
OffsetNumber i,
@@ -490,7 +492,8 @@ vacuumLeafRoot(spgBulkDeleteState *bds, Relation index, Buffer buffer)
static void
vacuumRedirectAndPlaceholder(Relation index, Buffer buffer)
{
Page page = BufferGetPage(buffer);
Page page = BufferGetPage(buffer, NULL, NULL,
BGP_NO_SNAPSHOT_TEST);
SpGistPageOpaque opaque = SpGistPageGetOpaque(page);
OffsetNumber i,
max = PageGetMaxOffsetNumber(page),
@@ -615,7 +618,7 @@ spgvacuumpage(spgBulkDeleteState *bds, BlockNumber blkno)
buffer = ReadBufferExtended(index, MAIN_FORKNUM, blkno,
RBM_NORMAL, bds->info->strategy);
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
page = (Page) BufferGetPage(buffer);
page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
if (PageIsNew(page))
{
@@ -696,7 +699,7 @@ spgprocesspending(spgBulkDeleteState *bds)
buffer = ReadBufferExtended(index, MAIN_FORKNUM, blkno,
RBM_NORMAL, bds->info->strategy);
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
page = (Page) BufferGetPage(buffer);
page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
if (PageIsNew(page) || SpGistPageIsDeleted(page))
{