MCPcopy Create free account
hub / github.com/apache/cloudberry / TestForOldSnapshot

Function TestForOldSnapshot

src/include/storage/bufmgr.h:300–312  ·  view source on GitHub ↗

* Check whether the given snapshot is too old to have safely read the given * page from the given table. If so, throw a "snapshot too old" error. * * This test generally needs to be performed after every BufferGetPage() call * that is executed as part of a scan. It is not needed for calls made for * modifying the page (for example, to position to the right place to insert a * new index tup

Source from the content-addressed store, hash-verified

298 * exclude a page from old snapshot testing near the front.
299 */
300static inline void
301TestForOldSnapshot(Snapshot snapshot, Relation relation, Page page)
302{
303 Assert(relation != NULL);
304
305 if (old_snapshot_threshold >= 0
306 && (snapshot) != NULL
307 && ((snapshot)->snapshot_type == SNAPSHOT_MVCC
308 || (snapshot)->snapshot_type == SNAPSHOT_TOAST)
309 && !XLogRecPtrIsInvalid((snapshot)->lsn)
310 && PageGetLSN(page) > (snapshot)->lsn)
311 TestForOldSnapshot_impl(snapshot, relation);
312}
313
314#endif /* FRONTEND */
315

Callers 15

blgetbitmapFunction · 0.85
spgWalkFunction · 0.85
collectMatchBitmapFunction · 0.85
scanGetCandidateFunction · 0.85
collectMatchesForHeapRowFunction · 0.85
scanPendingInsertFunction · 0.85
ginFindLeafPageFunction · 0.85
brinRevmapInitializeFunction · 0.85
brinGetTupleForHeapBlockFunction · 0.85
heapgetpageFunction · 0.85
heapgettupFunction · 0.85
heapgettup_pagemodeFunction · 0.85

Calls 2

PageGetLSNFunction · 0.85
TestForOldSnapshot_implFunction · 0.85

Tested by

no test coverage detected