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/transam/generic_xlog.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/transam/generic_xlog.c')
-rw-r--r-- | src/backend/access/transam/generic_xlog.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/backend/access/transam/generic_xlog.c b/src/backend/access/transam/generic_xlog.c index 87a4861cddb..6e213e2f60c 100644 --- a/src/backend/access/transam/generic_xlog.c +++ b/src/backend/access/transam/generic_xlog.c @@ -298,9 +298,7 @@ GenericXLogRegisterBuffer(GenericXLogState *state, Buffer buffer, int flags) /* Empty slot, so use it (there cannot be a match later) */ page->buffer = buffer; page->flags = flags; - memcpy(page->image, - BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST), - BLCKSZ); + memcpy(page->image, BufferGetPage(buffer), BLCKSZ); return (Page) page->image; } else if (page->buffer == buffer) @@ -345,8 +343,7 @@ GenericXLogFinish(GenericXLogState *state) if (BufferIsInvalid(pageData->buffer)) continue; - page = BufferGetPage(pageData->buffer, NULL, NULL, - BGP_NO_SNAPSHOT_TEST); + page = BufferGetPage(pageData->buffer); pageHeader = (PageHeader) pageData->image; if (pageData->flags & GENERIC_XLOG_FULL_IMAGE) @@ -399,8 +396,7 @@ GenericXLogFinish(GenericXLogState *state) if (BufferIsInvalid(pageData->buffer)) continue; - PageSetLSN(BufferGetPage(pageData->buffer, NULL, NULL, - BGP_NO_SNAPSHOT_TEST), lsn); + PageSetLSN(BufferGetPage(pageData->buffer), lsn); MarkBufferDirty(pageData->buffer); } END_CRIT_SECTION(); @@ -415,8 +411,7 @@ GenericXLogFinish(GenericXLogState *state) if (BufferIsInvalid(pageData->buffer)) continue; - memcpy(BufferGetPage(pageData->buffer, NULL, NULL, - BGP_NO_SNAPSHOT_TEST), + memcpy(BufferGetPage(pageData->buffer), pageData->image, BLCKSZ); /* We don't worry about zeroing the "hole" in this case */ @@ -502,8 +497,7 @@ generic_redo(XLogReaderState *record) char *blockDelta; Size blockDeltaSize; - page = BufferGetPage(buffers[block_id], NULL, NULL, - BGP_NO_SNAPSHOT_TEST); + page = BufferGetPage(buffers[block_id]); blockDelta = XLogRecGetBlockData(record, block_id, &blockDeltaSize); applyPageRedo(page, blockDelta, blockDeltaSize); |