mirror of
https://github.com/postgres/postgres.git
synced 2025-08-19 23:22:23 +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:
@@ -100,7 +100,6 @@ ginFindLeafPage(GinBtree btree, bool searchMode,
|
||||
stack->off = InvalidOffsetNumber;
|
||||
|
||||
page = BufferGetPage(stack->buffer);
|
||||
TestForOldSnapshot(snapshot, btree->index, page);
|
||||
|
||||
access = ginTraverseLock(stack->buffer, searchMode);
|
||||
|
||||
@@ -127,7 +126,6 @@ ginFindLeafPage(GinBtree btree, bool searchMode,
|
||||
stack->buffer = ginStepRight(stack->buffer, btree->index, access);
|
||||
stack->blkno = rightlink;
|
||||
page = BufferGetPage(stack->buffer);
|
||||
TestForOldSnapshot(snapshot, btree->index, page);
|
||||
|
||||
if (!searchMode && GinPageIsIncompleteSplit(page))
|
||||
ginFinishSplit(btree, stack, false, NULL);
|
||||
|
@@ -158,7 +158,6 @@ collectMatchBitmap(GinBtreeData *btree, GinBtreeStack *stack,
|
||||
return true;
|
||||
|
||||
page = BufferGetPage(stack->buffer);
|
||||
TestForOldSnapshot(snapshot, btree->index, page);
|
||||
itup = (IndexTuple) PageGetItem(page, PageGetItemId(page, stack->off));
|
||||
|
||||
/*
|
||||
@@ -1460,7 +1459,6 @@ scanGetCandidate(IndexScanDesc scan, pendingPosition *pos)
|
||||
for (;;)
|
||||
{
|
||||
page = BufferGetPage(pos->pendingBuffer);
|
||||
TestForOldSnapshot(scan->xs_snapshot, scan->indexRelation, page);
|
||||
|
||||
maxoff = PageGetMaxOffsetNumber(page);
|
||||
if (pos->firstOffset > maxoff)
|
||||
@@ -1641,7 +1639,6 @@ collectMatchesForHeapRow(IndexScanDesc scan, pendingPosition *pos)
|
||||
sizeof(bool) * (pos->lastOffset - pos->firstOffset));
|
||||
|
||||
page = BufferGetPage(pos->pendingBuffer);
|
||||
TestForOldSnapshot(scan->xs_snapshot, scan->indexRelation, page);
|
||||
|
||||
for (i = 0; i < so->nkeys; i++)
|
||||
{
|
||||
@@ -1844,7 +1841,6 @@ scanPendingInsert(IndexScanDesc scan, TIDBitmap *tbm, int64 *ntids)
|
||||
|
||||
LockBuffer(metabuffer, GIN_SHARE);
|
||||
page = BufferGetPage(metabuffer);
|
||||
TestForOldSnapshot(scan->xs_snapshot, scan->indexRelation, page);
|
||||
blkno = GinPageGetMeta(page)->head;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user