diff options
author | Kevin Grittner <kgrittn@postgresql.org> | 2016-04-08 14:30:10 -0500 |
---|---|---|
committer | Kevin Grittner <kgrittn@postgresql.org> | 2016-04-08 14:30:10 -0500 |
commit | 8b65cf4c5edabdcae45ceaef7b9ac236879aae50 (patch) | |
tree | f4412d3e9bc0db823ac32e08fac8e3124b42ff02 /src/backend/access/hash/hashpage.c | |
parent | 689f9a058854a1a32e994818dd6d79f49d8f8a1b (diff) | |
download | postgresql-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/hashpage.c')
-rw-r--r-- | src/backend/access/hash/hashpage.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/backend/access/hash/hashpage.c b/src/backend/access/hash/hashpage.c index 178463fcb65..2e2588be3b7 100644 --- a/src/backend/access/hash/hashpage.c +++ b/src/backend/access/hash/hashpage.c @@ -161,7 +161,8 @@ _hash_getinitbuf(Relation rel, BlockNumber blkno) /* ref count and lock type are correct */ /* initialize the page */ - _hash_pageinit(BufferGetPage(buf), BufferGetPageSize(buf)); + _hash_pageinit(BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST), + BufferGetPageSize(buf)); return buf; } @@ -210,7 +211,8 @@ _hash_getnewbuf(Relation rel, BlockNumber blkno, ForkNumber forkNum) /* ref count and lock type are correct */ /* initialize the page */ - _hash_pageinit(BufferGetPage(buf), BufferGetPageSize(buf)); + _hash_pageinit(BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST), + BufferGetPageSize(buf)); return buf; } @@ -384,7 +386,7 @@ _hash_metapinit(Relation rel, double num_tuples, ForkNumber forkNum) * the physical index length. */ metabuf = _hash_getnewbuf(rel, HASH_METAPAGE, forkNum); - pg = BufferGetPage(metabuf); + pg = BufferGetPage(metabuf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); pageopaque = (HashPageOpaque) PageGetSpecialPointer(pg); pageopaque->hasho_prevblkno = InvalidBlockNumber; @@ -452,7 +454,7 @@ _hash_metapinit(Relation rel, double num_tuples, ForkNumber forkNum) CHECK_FOR_INTERRUPTS(); buf = _hash_getnewbuf(rel, BUCKET_TO_BLKNO(metap, i), forkNum); - pg = BufferGetPage(buf); + pg = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); pageopaque = (HashPageOpaque) PageGetSpecialPointer(pg); pageopaque->hasho_prevblkno = InvalidBlockNumber; pageopaque->hasho_nextblkno = InvalidBlockNumber; @@ -517,7 +519,8 @@ _hash_expandtable(Relation rel, Buffer metabuf) _hash_chgbufaccess(rel, metabuf, HASH_NOLOCK, HASH_WRITE); _hash_checkpage(rel, metabuf, LH_META_PAGE); - metap = HashPageGetMeta(BufferGetPage(metabuf)); + metap = HashPageGetMeta(BufferGetPage(metabuf, NULL, NULL, + BGP_NO_SNAPSHOT_TEST)); /* * Check to see if split is still needed; someone else might have already @@ -774,10 +777,10 @@ _hash_splitbucket(Relation rel, * either bucket. */ obuf = _hash_getbuf(rel, start_oblkno, HASH_WRITE, LH_BUCKET_PAGE); - opage = BufferGetPage(obuf); + opage = BufferGetPage(obuf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); oopaque = (HashPageOpaque) PageGetSpecialPointer(opage); - npage = BufferGetPage(nbuf); + npage = BufferGetPage(nbuf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); /* initialize the new bucket's primary page */ nopaque = (HashPageOpaque) PageGetSpecialPointer(npage); @@ -841,7 +844,7 @@ _hash_splitbucket(Relation rel, _hash_chgbufaccess(rel, nbuf, HASH_WRITE, HASH_NOLOCK); /* chain to a new overflow page */ nbuf = _hash_addovflpage(rel, metabuf, nbuf); - npage = BufferGetPage(nbuf); + npage = BufferGetPage(nbuf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); /* we don't need nopaque within the loop */ } @@ -888,7 +891,7 @@ _hash_splitbucket(Relation rel, /* Else, advance to next old page */ obuf = _hash_getbuf(rel, oblkno, HASH_WRITE, LH_OVERFLOW_PAGE); - opage = BufferGetPage(obuf); + opage = BufferGetPage(obuf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); oopaque = (HashPageOpaque) PageGetSpecialPointer(opage); } |