aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/bufmgr.c
diff options
context:
space:
mode:
authorKevin Grittner <kgrittn@postgresql.org>2016-04-20 08:31:19 -0500
committerKevin Grittner <kgrittn@postgresql.org>2016-04-20 08:31:19 -0500
commita343e223a5c33a7283a6d8b255c9dbc48dbc5061 (patch)
treef02f3de305180170d8d5e51120861ae6770b31e8 /src/backend/storage/buffer/bufmgr.c
parent4db0d2d2fe935e086dfd26c00f707dab298b443c (diff)
downloadpostgresql-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/storage/buffer/bufmgr.c')
-rw-r--r--src/backend/storage/buffer/bufmgr.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index 939f5893432..ac1e513560c 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -2815,7 +2815,7 @@ XLogRecPtr
BufferGetLSNAtomic(Buffer buffer)
{
BufferDesc *bufHdr = GetBufferDescriptor(buffer - 1);
- char *page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
+ char *page = BufferGetPage(buffer);
XLogRecPtr lsn;
uint32 buf_state;
@@ -3362,7 +3362,7 @@ void
MarkBufferDirtyHint(Buffer buffer, bool buffer_std)
{
BufferDesc *bufHdr;
- Page page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
+ Page page = BufferGetPage(buffer);
if (!BufferIsValid(buffer))
elog(ERROR, "bad buffer ID: %d", buffer);
@@ -4288,10 +4288,8 @@ IssuePendingWritebacks(WritebackContext *context)
* This test generally needs to be performed after every BufferGetPage() call
* that is executed as part of a scan. It is not needed for calls made for
* modifying the page (for example, to position to the right place to insert a
- * new index tuple or for vacuuming). To minimize errors of omission, the
- * BufferGetPage() macro accepts parameters to specify whether the test should
- * be run, and supply the necessary snapshot and relation parameters. See the
- * declaration of BufferGetPage() for more details.
+ * new index tuple or for vacuuming). It may also be omitted where calls to
+ * lower-level functions will have already performed the test.
*
* Note that a NULL snapshot argument is allowed and causes a fast return
* without error; this is to support call sites which can be called from