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/gist/gistget.c | |
parent | 4db0d2d2fe935e086dfd26c00f707dab298b443c (diff) | |
download | postgresql-a343e223a5c33a7283a6d8b255c9dbc48dbc5061.tar.gz postgresql-a343e223a5c33a7283a6d8b255c9dbc48dbc5061.zip |
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/gist/gistget.c')
-rw-r--r-- | src/backend/access/gist/gistget.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c index 24af868466d..affd63535ad 100644 --- a/src/backend/access/gist/gistget.c +++ b/src/backend/access/gist/gistget.c @@ -54,7 +54,7 @@ gistkillitems(IndexScanDesc scan) LockBuffer(buffer, GIST_SHARE); gistcheckpage(scan->indexRelation, buffer); - page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST); + page = BufferGetPage(buffer); /* * If page LSN differs it means that the page was modified since the last read. @@ -336,7 +336,8 @@ gistScanPage(IndexScanDesc scan, GISTSearchItem *pageItem, double *myDistances, buffer = ReadBuffer(scan->indexRelation, pageItem->blkno); LockBuffer(buffer, GIST_SHARE); gistcheckpage(scan->indexRelation, buffer); - page = BufferGetPage(buffer, scan->xs_snapshot, r, BGP_TEST_FOR_OLD_SNAPSHOT); + page = BufferGetPage(buffer); + TestForOldSnapshot(scan->xs_snapshot, r, page); opaque = GistPageGetOpaque(page); /* |