summaryrefslogtreecommitdiff
path: root/src/include/storage/bufmgr.h
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2023-09-05 18:26:12 +1200
committerThomas Munro <tmunro@postgresql.org>2023-09-05 19:53:43 +1200
commitf691f5b80a85c66d715b4340ffabb503eb19393e (patch)
tree26a06c87096de2f9571956b4370ccbf1852d4cba /src/include/storage/bufmgr.h
parentaa0d3504560d40f4300a3d49d1c6c3bfc3b894e5 (diff)
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
Diffstat (limited to 'src/include/storage/bufmgr.h')
-rw-r--r--src/include/storage/bufmgr.h36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h
index b379c76e273..d89021f9187 100644
--- a/src/include/storage/bufmgr.h
+++ b/src/include/storage/bufmgr.h
@@ -250,8 +250,6 @@ extern void AbortBufferIO(Buffer buffer);
extern bool BgBufferSync(struct WritebackContext *wb_context);
-extern void TestForOldSnapshot_impl(Snapshot snapshot, Relation relation);
-
/* in buf_init.c */
extern void InitBufferPool(void);
extern Size BufferShmemSize(void);
@@ -347,9 +345,6 @@ BufferGetPageSize(Buffer buffer)
/*
* BufferGetPage
* Returns the page associated with a buffer.
- *
- * When this is called as part of a scan, there may be a need for a nearby
- * call to TestForOldSnapshot(). See the definition of that for details.
*/
static inline Page
BufferGetPage(Buffer buffer)
@@ -357,37 +352,6 @@ BufferGetPage(Buffer buffer)
return (Page) BufferGetBlock(buffer);
}
-/*
- * 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 tuple or for vacuuming). It may also be omitted where calls to
- * lower-level functions will have already performed the test.
- *
- * Note that a NULL snapshot argument is allowed and causes a fast return
- * without error; this is to support call sites which can be called from
- * either scans or index modification areas.
- *
- * For best performance, keep the tests that are fastest and/or most likely to
- * exclude a page from old snapshot testing near the front.
- */
-static inline void
-TestForOldSnapshot(Snapshot snapshot, Relation relation, Page page)
-{
- Assert(relation != NULL);
-
- if (old_snapshot_threshold >= 0
- && (snapshot) != NULL
- && ((snapshot)->snapshot_type == SNAPSHOT_MVCC
- || (snapshot)->snapshot_type == SNAPSHOT_TOAST)
- && !XLogRecPtrIsInvalid((snapshot)->lsn)
- && PageGetLSN(page) > (snapshot)->lsn)
- TestForOldSnapshot_impl(snapshot, relation);
-}
-
#endif /* FRONTEND */
#endif /* BUFMGR_H */