mirror of
https://github.com/postgres/postgres.git
synced 2025-11-21 00:42:43 +03:00
Remove the "snapshot too old" feature.
Remove the old_snapshot_threshold setting and mechanism for producing
the error "snapshot too old", originally added by commit 848ef42b.
Unfortunately it had a number of known problems in terms of correctness
and performance, mostly reported by Andres in the course of his work on
snapshot scalability. We agreed to remove it, after a long period
without an active plan to fix it.
This is certainly a desirable feature, and someone might propose a new
or improved implementation in the future.
Reported-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CACG%3DezYV%2BEvO135fLRdVn-ZusfVsTY6cH1OZqWtezuEYH6ciQA%40mail.gmail.com
Discussion: https://postgr.es/m/20200401064008.qob7bfnnbu4w5cw4%40alap3.anarazel.de
Discussion: https://postgr.es/m/CA%2BTgmoY%3Daqf0zjTD%2B3dUWYkgMiNDegDLFjo%2B6ze%3DWtpik%2B3XqA%40mail.gmail.com
This commit is contained in:
@@ -425,7 +425,6 @@ heapgetpage(TableScanDesc sscan, BlockNumber block)
|
||||
LockBuffer(buffer, BUFFER_LOCK_SHARE);
|
||||
|
||||
page = BufferGetPage(buffer);
|
||||
TestForOldSnapshot(snapshot, scan->rs_base.rs_rd, page);
|
||||
lines = PageGetMaxOffsetNumber(page);
|
||||
ntup = 0;
|
||||
|
||||
@@ -565,8 +564,6 @@ heapgettup_start_page(HeapScanDesc scan, ScanDirection dir, int *linesleft,
|
||||
/* Caller is responsible for ensuring buffer is locked if needed */
|
||||
page = BufferGetPage(scan->rs_cbuf);
|
||||
|
||||
TestForOldSnapshot(scan->rs_base.rs_snapshot, scan->rs_base.rs_rd, page);
|
||||
|
||||
*linesleft = PageGetMaxOffsetNumber(page) - FirstOffsetNumber + 1;
|
||||
|
||||
if (ScanDirectionIsForward(dir))
|
||||
@@ -598,8 +595,6 @@ heapgettup_continue_page(HeapScanDesc scan, ScanDirection dir, int *linesleft,
|
||||
/* Caller is responsible for ensuring buffer is locked if needed */
|
||||
page = BufferGetPage(scan->rs_cbuf);
|
||||
|
||||
TestForOldSnapshot(scan->rs_base.rs_snapshot, scan->rs_base.rs_rd, page);
|
||||
|
||||
if (ScanDirectionIsForward(dir))
|
||||
{
|
||||
*lineoff = OffsetNumberNext(scan->rs_coffset);
|
||||
@@ -864,7 +859,6 @@ heapgettup_pagemode(HeapScanDesc scan,
|
||||
/* continue from previously returned page/tuple */
|
||||
block = scan->rs_cblock; /* current page */
|
||||
page = BufferGetPage(scan->rs_cbuf);
|
||||
TestForOldSnapshot(scan->rs_base.rs_snapshot, scan->rs_base.rs_rd, page);
|
||||
|
||||
lineindex = scan->rs_cindex + dir;
|
||||
if (ScanDirectionIsForward(dir))
|
||||
@@ -884,7 +878,6 @@ heapgettup_pagemode(HeapScanDesc scan,
|
||||
{
|
||||
heapgetpage((TableScanDesc) scan, block);
|
||||
page = BufferGetPage(scan->rs_cbuf);
|
||||
TestForOldSnapshot(scan->rs_base.rs_snapshot, scan->rs_base.rs_rd, page);
|
||||
linesleft = scan->rs_ntuples;
|
||||
lineindex = ScanDirectionIsForward(dir) ? 0 : linesleft - 1;
|
||||
|
||||
@@ -1372,7 +1365,6 @@ heap_fetch(Relation relation,
|
||||
*/
|
||||
LockBuffer(buffer, BUFFER_LOCK_SHARE);
|
||||
page = BufferGetPage(buffer);
|
||||
TestForOldSnapshot(snapshot, relation, page);
|
||||
|
||||
/*
|
||||
* We'd better check for out-of-range offnum in case of VACUUM since the
|
||||
@@ -1663,7 +1655,6 @@ heap_get_latest_tid(TableScanDesc sscan,
|
||||
buffer = ReadBuffer(relation, ItemPointerGetBlockNumber(&ctid));
|
||||
LockBuffer(buffer, BUFFER_LOCK_SHARE);
|
||||
page = BufferGetPage(buffer);
|
||||
TestForOldSnapshot(snapshot, relation, page);
|
||||
|
||||
/*
|
||||
* Check for bogus item number. This is not treated as an error
|
||||
|
||||
Reference in New Issue
Block a user