diff options
author | Kevin Grittner <kgrittn@postgresql.org> | 2016-04-20 08:31:19 -0500 |
---|---|---|
committer | Kevin Grittner <kgrittn@postgresql.org> | 2016-04-20 08:31:19 -0500 |
commit | a343e223a5c33a7283a6d8b255c9dbc48dbc5061 (patch) | |
tree | f02f3de305180170d8d5e51120861ae6770b31e8 /src/backend/access/hash/hashinsert.c | |
parent | 4db0d2d2fe935e086dfd26c00f707dab298b443c (diff) |
Revert no-op changes to BufferGetPage()
The reverted changes were intended to force a choice of whether any
newly-added BufferGetPage() calls needed to be accompanied by a
test of the snapshot age, to support the "snapshot too old"
feature. Such an accompanying test is needed in about 7% of the
cases, where the page is being used as part of a scan rather than
positioning for other purposes (such as DML or vacuuming). The
additional effort required for back-patching, and the doubt whether
the intended benefit would really be there, have indicated it is
best just to rely on developers to do the right thing based on
comments and existing usage, as we do with many other conventions.
This change should have little or no effect on generated executable
code.
Motivated by the back-patching pain of Tom Lane and Robert Haas
Diffstat (limited to 'src/backend/access/hash/hashinsert.c')
-rw-r--r-- | src/backend/access/hash/hashinsert.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/backend/access/hash/hashinsert.c b/src/backend/access/hash/hashinsert.c index 92152e31044..acd2e647638 100644 --- a/src/backend/access/hash/hashinsert.c +++ b/src/backend/access/hash/hashinsert.c @@ -53,8 +53,7 @@ _hash_doinsert(Relation rel, IndexTuple itup) /* Read the metapage */ metabuf = _hash_getbuf(rel, HASH_METAPAGE, HASH_READ, LH_META_PAGE); - metap = HashPageGetMeta(BufferGetPage(metabuf, NULL, NULL, - BGP_NO_SNAPSHOT_TEST)); + metap = HashPageGetMeta(BufferGetPage(metabuf)); /* * Check whether the item can fit on a hash page at all. (Eventually, we @@ -112,7 +111,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, NULL, NULL, BGP_NO_SNAPSHOT_TEST); + page = BufferGetPage(buf); pageopaque = (HashPageOpaque) PageGetSpecialPointer(page); Assert(pageopaque->hasho_bucket == bucket); @@ -132,7 +131,7 @@ _hash_doinsert(Relation rel, IndexTuple itup) */ _hash_relbuf(rel, buf); buf = _hash_getbuf(rel, nextblkno, HASH_WRITE, LH_OVERFLOW_PAGE); - page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); + page = BufferGetPage(buf); } else { @@ -146,7 +145,7 @@ _hash_doinsert(Relation rel, IndexTuple itup) /* chain to a new overflow page */ buf = _hash_addovflpage(rel, metabuf, buf); - page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST); + page = BufferGetPage(buf); /* should fit now, given test above */ Assert(PageGetFreeSpace(page) >= itemsz); @@ -207,7 +206,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, NULL, NULL, BGP_NO_SNAPSHOT_TEST); + page = BufferGetPage(buf); /* Find where to insert the tuple (preserving page's hashkey ordering) */ hashkey = _hash_get_indextuple_hashkey(itup); |