mirror of
https://github.com/postgres/postgres.git
synced 2025-08-22 21:53:06 +03:00
Modify BufferGetPage() to prepare for "snapshot too old" feature
This patch is a no-op patch which is intended to reduce the chances of failures of omission once the functional part of the "snapshot too old" patch goes in. It adds parameters for snapshot, relation, and an enum to specify whether the snapshot age check needs to be done for the page at this point. This initial patch passes NULL for the first two new parameters and BGP_NO_SNAPSHOT_TEST for the third. The follow-on patch will change the places where the test needs to be made.
This commit is contained in:
@@ -301,7 +301,7 @@ spgLeafTest(Relation index, SpGistScanOpaque so,
|
||||
*/
|
||||
static void
|
||||
spgWalk(Relation index, SpGistScanOpaque so, bool scanWholeIndex,
|
||||
storeRes_func storeRes)
|
||||
storeRes_func storeRes, Snapshot snapshot)
|
||||
{
|
||||
Buffer buffer = InvalidBuffer;
|
||||
bool reportedSome = false;
|
||||
@@ -341,7 +341,7 @@ redirect:
|
||||
}
|
||||
/* else new pointer points to the same page, no work needed */
|
||||
|
||||
page = BufferGetPage(buffer);
|
||||
page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
|
||||
|
||||
isnull = SpGistPageStoresNulls(page) ? true : false;
|
||||
|
||||
@@ -576,7 +576,7 @@ spggetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
|
||||
so->tbm = tbm;
|
||||
so->ntids = 0;
|
||||
|
||||
spgWalk(scan->indexRelation, so, true, storeBitmap);
|
||||
spgWalk(scan->indexRelation, so, true, storeBitmap, scan->xs_snapshot);
|
||||
|
||||
return so->ntids;
|
||||
}
|
||||
@@ -635,7 +635,8 @@ spggettuple(IndexScanDesc scan, ScanDirection dir)
|
||||
}
|
||||
so->iPtr = so->nPtrs = 0;
|
||||
|
||||
spgWalk(scan->indexRelation, so, false, storeGettuple);
|
||||
spgWalk(scan->indexRelation, so, false, storeGettuple,
|
||||
scan->xs_snapshot);
|
||||
|
||||
if (so->nPtrs == 0)
|
||||
break; /* must have completed scan */
|
||||
|
Reference in New Issue
Block a user