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 /contrib/pgstattuple/pgstattuple.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 'contrib/pgstattuple/pgstattuple.c')
-rw-r--r-- | contrib/pgstattuple/pgstattuple.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/pgstattuple/pgstattuple.c b/contrib/pgstattuple/pgstattuple.c index c1122b496ad..46655ac01c5 100644 --- a/contrib/pgstattuple/pgstattuple.c +++ b/contrib/pgstattuple/pgstattuple.c @@ -320,7 +320,8 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo) buffer = ReadBufferExtended(rel, MAIN_FORKNUM, block, RBM_NORMAL, scan->rs_strategy); LockBuffer(buffer, BUFFER_LOCK_SHARE); - stat.free_space += PageGetHeapFreeSpace((Page) BufferGetPage(buffer)); + stat.free_space += PageGetHeapFreeSpace + (BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST)); UnlockReleaseBuffer(buffer); block++; } @@ -333,7 +334,8 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo) buffer = ReadBufferExtended(rel, MAIN_FORKNUM, block, RBM_NORMAL, scan->rs_strategy); LockBuffer(buffer, BUFFER_LOCK_SHARE); - stat.free_space += PageGetHeapFreeSpace((Page) BufferGetPage(buffer)); + stat.free_space += PageGetHeapFreeSpace + (BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST)); UnlockReleaseBuffer(buffer); block++; } @@ -358,7 +360,7 @@ pgstat_btree_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno, buf = ReadBufferExtended(rel, MAIN_FORKNUM, blkno, RBM_NORMAL, bstrategy); LockBuffer(buf, BT_READ); - page = BufferGetPage(buf); + page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); /* Page is valid, see what to do with it */ if (PageIsNew(page)) @@ -402,7 +404,7 @@ pgstat_hash_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno, _hash_getlock(rel, blkno, HASH_SHARE); buf = _hash_getbuf_with_strategy(rel, blkno, HASH_READ, 0, bstrategy); - page = BufferGetPage(buf); + page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); if (PageGetSpecialSize(page) == MAXALIGN(sizeof(HashPageOpaqueData))) { @@ -447,7 +449,7 @@ pgstat_gist_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno, buf = ReadBufferExtended(rel, MAIN_FORKNUM, blkno, RBM_NORMAL, bstrategy); LockBuffer(buf, GIST_SHARE); gistcheckpage(rel, buf); - page = BufferGetPage(buf); + page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); if (GistPageIsLeaf(page)) { |