summaryrefslogtreecommitdiff
path: root/contrib/bloom
diff options
context:
space:
mode:
authorKevin Grittner2016-04-08 19:30:10 +0000
committerKevin Grittner2016-04-08 19:30:10 +0000
commit8b65cf4c5edabdcae45ceaef7b9ac236879aae50 (patch)
treef4412d3e9bc0db823ac32e08fac8e3124b42ff02 /contrib/bloom
parent689f9a058854a1a32e994818dd6d79f49d8f8a1b (diff)
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 'contrib/bloom')
-rw-r--r--contrib/bloom/blinsert.c3
-rw-r--r--contrib/bloom/blscan.c2
-rw-r--r--contrib/bloom/blutils.c8
-rw-r--r--contrib/bloom/blvacuum.c2
4 files changed, 9 insertions, 6 deletions
diff --git a/contrib/bloom/blinsert.c b/contrib/bloom/blinsert.c
index 6eecb12187d..cc12808375b 100644
--- a/contrib/bloom/blinsert.c
+++ b/contrib/bloom/blinsert.c
@@ -204,7 +204,8 @@ blinsert(Relation index, Datum *values, bool *isnull,
*/
metaBuffer = ReadBuffer(index, BLOOM_METAPAGE_BLKNO);
LockBuffer(metaBuffer, BUFFER_LOCK_SHARE);
- metaData = BloomPageGetMeta(BufferGetPage(metaBuffer));
+ metaData = BloomPageGetMeta(BufferGetPage(metaBuffer, NULL, NULL,
+ BGP_NO_SNAPSHOT_TEST));
if (metaData->nEnd > metaData->nStart)
{
diff --git a/contrib/bloom/blscan.c b/contrib/bloom/blscan.c
index ba137835494..ae937f66710 100644
--- a/contrib/bloom/blscan.c
+++ b/contrib/bloom/blscan.c
@@ -138,7 +138,7 @@ blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
blkno, RBM_NORMAL, bas);
LockBuffer(buffer, BUFFER_LOCK_SHARE);
- page = BufferGetPage(buffer);
+ page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
if (!BloomPageIsDeleted(page))
{
diff --git a/contrib/bloom/blutils.c b/contrib/bloom/blutils.c
index 76d6ba80222..6c7dc1d07d1 100644
--- a/contrib/bloom/blutils.c
+++ b/contrib/bloom/blutils.c
@@ -139,11 +139,12 @@ initBloomState(BloomState *state, Relation index)
buffer = ReadBuffer(index, BLOOM_METAPAGE_BLKNO);
LockBuffer(buffer, BUFFER_LOCK_SHARE);
- page = BufferGetPage(buffer);
+ page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
if (!BloomPageIsMeta(page))
elog(ERROR, "Relation is not a bloom index");
- meta = BloomPageGetMeta(BufferGetPage(buffer));
+ meta = BloomPageGetMeta(BufferGetPage(buffer, NULL, NULL,
+ BGP_NO_SNAPSHOT_TEST));
if (meta->magickNumber != BLOOM_MAGICK_NUMBER)
elog(ERROR, "Relation is not a bloom index");
@@ -315,7 +316,8 @@ BloomNewBuffer(Relation index)
*/
if (ConditionalLockBuffer(buffer))
{
- Page page = BufferGetPage(buffer);
+ Page page = BufferGetPage(buffer, NULL, NULL,
+ BGP_NO_SNAPSHOT_TEST);
if (PageIsNew(page))
return buffer; /* OK to use, if never initialized */
diff --git a/contrib/bloom/blvacuum.c b/contrib/bloom/blvacuum.c
index 19c010c2524..ee40ebbd973 100644
--- a/contrib/bloom/blvacuum.c
+++ b/contrib/bloom/blvacuum.c
@@ -194,7 +194,7 @@ blvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
buffer = ReadBufferExtended(index, MAIN_FORKNUM, blkno,
RBM_NORMAL, info->strategy);
LockBuffer(buffer, BUFFER_LOCK_SHARE);
- page = (Page) BufferGetPage(buffer);
+ page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
if (BloomPageIsDeleted(page))
{