mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
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
This commit is contained in:
@@ -74,7 +74,7 @@ static void heap_prune_record_unused(PruneState *prstate, OffsetNumber offnum);
|
||||
void
|
||||
heap_page_prune_opt(Relation relation, Buffer buffer)
|
||||
{
|
||||
Page page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
|
||||
Page page = BufferGetPage(buffer);
|
||||
Size minfree;
|
||||
TransactionId OldestXmin;
|
||||
|
||||
@@ -183,7 +183,7 @@ heap_page_prune(Relation relation, Buffer buffer, TransactionId OldestXmin,
|
||||
bool report_stats, TransactionId *latestRemovedXid)
|
||||
{
|
||||
int ndeleted = 0;
|
||||
Page page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
|
||||
Page page = BufferGetPage(buffer);
|
||||
OffsetNumber offnum,
|
||||
maxoff;
|
||||
PruneState prstate;
|
||||
@@ -270,8 +270,7 @@ heap_page_prune(Relation relation, Buffer buffer, TransactionId OldestXmin,
|
||||
prstate.nowunused, prstate.nunused,
|
||||
prstate.latestRemovedXid);
|
||||
|
||||
PageSetLSN(BufferGetPage(buffer, NULL, NULL,
|
||||
BGP_NO_SNAPSHOT_TEST), recptr);
|
||||
PageSetLSN(BufferGetPage(buffer), recptr);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -357,7 +356,7 @@ heap_prune_chain(Relation relation, Buffer buffer, OffsetNumber rootoffnum,
|
||||
PruneState *prstate)
|
||||
{
|
||||
int ndeleted = 0;
|
||||
Page dp = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
|
||||
Page dp = (Page) BufferGetPage(buffer);
|
||||
TransactionId priorXmax = InvalidTransactionId;
|
||||
ItemId rootlp;
|
||||
HeapTupleHeader htup;
|
||||
@@ -683,8 +682,7 @@ heap_page_prune_execute(Buffer buffer,
|
||||
OffsetNumber *nowdead, int ndead,
|
||||
OffsetNumber *nowunused, int nunused)
|
||||
{
|
||||
Page page = BufferGetPage(buffer, NULL, NULL,
|
||||
BGP_NO_SNAPSHOT_TEST);
|
||||
Page page = (Page) BufferGetPage(buffer);
|
||||
OffsetNumber *offnum;
|
||||
int i;
|
||||
|
||||
|
Reference in New Issue
Block a user