aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/hash/hashinsert.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/access/hash/hashinsert.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/access/hash/hashinsert.c')
-rw-r--r--src/backend/access/hash/hashinsert.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/access/hash/hashinsert.c b/src/backend/access/hash/hashinsert.c
index acd2e647638..92152e31044 100644
--- a/src/backend/access/hash/hashinsert.c
+++ b/src/backend/access/hash/hashinsert.c
@@ -53,7 +53,8 @@ _hash_doinsert(Relation rel, IndexTuple itup)
/* Read the metapage */
metabuf = _hash_getbuf(rel, HASH_METAPAGE, HASH_READ, LH_META_PAGE);
- metap = HashPageGetMeta(BufferGetPage(metabuf));
+ metap = HashPageGetMeta(BufferGetPage(metabuf, NULL, NULL,
+ BGP_NO_SNAPSHOT_TEST));
/*
* Check whether the item can fit on a hash page at all. (Eventually, we
@@ -111,7 +112,7 @@ _hash_doinsert(Relation rel, IndexTuple itup)
/* Fetch the primary bucket page for the bucket */
buf = _hash_getbuf(rel, blkno, HASH_WRITE, LH_BUCKET_PAGE);
- page = BufferGetPage(buf);
+ page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
pageopaque = (HashPageOpaque) PageGetSpecialPointer(page);
Assert(pageopaque->hasho_bucket == bucket);
@@ -131,7 +132,7 @@ _hash_doinsert(Relation rel, IndexTuple itup)
*/
_hash_relbuf(rel, buf);
buf = _hash_getbuf(rel, nextblkno, HASH_WRITE, LH_OVERFLOW_PAGE);
- page = BufferGetPage(buf);
+ page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
}
else
{
@@ -145,7 +146,7 @@ _hash_doinsert(Relation rel, IndexTuple itup)
/* chain to a new overflow page */
buf = _hash_addovflpage(rel, metabuf, buf);
- page = BufferGetPage(buf);
+ page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
/* should fit now, given test above */
Assert(PageGetFreeSpace(page) >= itemsz);
@@ -206,7 +207,7 @@ _hash_pgaddtup(Relation rel, Buffer buf, Size itemsize, IndexTuple itup)
uint32 hashkey;
_hash_checkpage(rel, buf, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE);
- page = BufferGetPage(buf);
+ page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
/* Find where to insert the tuple (preserving page's hashkey ordering) */
hashkey = _hash_get_indextuple_hashkey(itup);