* 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
| 298 | * exclude a page from old snapshot testing near the front. |
| 299 | */ |
| 300 | static inline void |
| 301 | TestForOldSnapshot(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 |
no test coverage detected