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/gin/ginutil.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/gin/ginutil.c')
-rw-r--r-- | src/backend/access/gin/ginutil.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/access/gin/ginutil.c b/src/backend/access/gin/ginutil.c index 94502678abb..de3532b80ef 100644 --- a/src/backend/access/gin/ginutil.c +++ b/src/backend/access/gin/ginutil.c @@ -273,7 +273,8 @@ GinNewBuffer(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 */ @@ -318,14 +319,15 @@ GinInitPage(Page page, uint32 f, Size pageSize) void GinInitBuffer(Buffer b, uint32 f) { - GinInitPage(BufferGetPage(b), f, BufferGetPageSize(b)); + GinInitPage(BufferGetPage(b, NULL, NULL, BGP_NO_SNAPSHOT_TEST), + f, BufferGetPageSize(b)); } void GinInitMetabuffer(Buffer b) { GinMetaPageData *metadata; - Page page = BufferGetPage(b); + Page page = BufferGetPage(b, NULL, NULL, BGP_NO_SNAPSHOT_TEST); GinInitPage(page, GIN_META, BufferGetPageSize(b)); @@ -605,7 +607,7 @@ ginGetStats(Relation index, GinStatsData *stats) metabuffer = ReadBuffer(index, GIN_METAPAGE_BLKNO); LockBuffer(metabuffer, GIN_SHARE); - metapage = BufferGetPage(metabuffer); + metapage = BufferGetPage(metabuffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST); metadata = GinPageGetMeta(metapage); stats->nPendingPages = metadata->nPendingPages; @@ -632,7 +634,7 @@ ginUpdateStats(Relation index, const GinStatsData *stats) metabuffer = ReadBuffer(index, GIN_METAPAGE_BLKNO); LockBuffer(metabuffer, GIN_EXCLUSIVE); - metapage = BufferGetPage(metabuffer); + metapage = BufferGetPage(metabuffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST); metadata = GinPageGetMeta(metapage); START_CRIT_SECTION(); |