aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/heapam.h2
-rw-r--r--src/include/storage/bufmgr.h36
-rw-r--r--src/include/utils/old_snapshot.h75
-rw-r--r--src/include/utils/snapmgr.h49
4 files changed, 0 insertions, 162 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h
index faf50265191..6598c4d7d8b 100644
--- a/src/include/access/heapam.h
+++ b/src/include/access/heapam.h
@@ -286,8 +286,6 @@ struct GlobalVisState;
extern void heap_page_prune_opt(Relation relation, Buffer buffer);
extern int heap_page_prune(Relation relation, Buffer buffer,
struct GlobalVisState *vistest,
- TransactionId old_snap_xmin,
- TimestampTz old_snap_ts,
int *nnewlpdead,
OffsetNumber *off_loc);
extern void heap_page_prune_execute(Buffer buffer,
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 */
diff --git a/src/include/utils/old_snapshot.h b/src/include/utils/old_snapshot.h
deleted file mode 100644
index f1978a28e1c..00000000000
--- a/src/include/utils/old_snapshot.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * old_snapshot.h
- * Data structures for 'snapshot too old'
- *
- * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * IDENTIFICATION
- * src/include/utils/old_snapshot.h
- *
- *-------------------------------------------------------------------------
- */
-
-#ifndef OLD_SNAPSHOT_H
-#define OLD_SNAPSHOT_H
-
-#include "datatype/timestamp.h"
-#include "storage/s_lock.h"
-
-/*
- * Structure for dealing with old_snapshot_threshold implementation.
- */
-typedef struct OldSnapshotControlData
-{
- /*
- * Variables for old snapshot handling are shared among processes and are
- * only allowed to move forward.
- */
- slock_t mutex_current; /* protect current_timestamp */
- TimestampTz current_timestamp; /* latest snapshot timestamp */
- slock_t mutex_latest_xmin; /* protect latest_xmin and next_map_update */
- TransactionId latest_xmin; /* latest snapshot xmin */
- TimestampTz next_map_update; /* latest snapshot valid up to */
- slock_t mutex_threshold; /* protect threshold fields */
- TimestampTz threshold_timestamp; /* earlier snapshot is old */
- TransactionId threshold_xid; /* earlier xid may be gone */
-
- /*
- * Keep one xid per minute for old snapshot error handling.
- *
- * Use a circular buffer with a head offset, a count of entries currently
- * used, and a timestamp corresponding to the xid at the head offset. A
- * count_used value of zero means that there are no times stored; a
- * count_used value of OLD_SNAPSHOT_TIME_MAP_ENTRIES means that the buffer
- * is full and the head must be advanced to add new entries. Use
- * timestamps aligned to minute boundaries, since that seems less
- * surprising than aligning based on the first usage timestamp. The
- * latest bucket is effectively stored within latest_xmin. The circular
- * buffer is updated when we get a new xmin value that doesn't fall into
- * the same interval.
- *
- * It is OK if the xid for a given time slot is from earlier than
- * calculated by adding the number of minutes corresponding to the
- * (possibly wrapped) distance from the head offset to the time of the
- * head entry, since that just results in the vacuuming of old tuples
- * being slightly less aggressive. It would not be OK for it to be off in
- * the other direction, since it might result in vacuuming tuples that are
- * still expected to be there.
- *
- * Use of an SLRU was considered but not chosen because it is more
- * heavyweight than is needed for this, and would probably not be any less
- * code to implement.
- *
- * Persistence is not needed.
- */
- int head_offset; /* subscript of oldest tracked time */
- TimestampTz head_timestamp; /* time corresponding to head xid */
- int count_used; /* how many slots are in use */
- TransactionId xid_by_minute[FLEXIBLE_ARRAY_MEMBER];
-} OldSnapshotControlData;
-
-extern PGDLLIMPORT volatile OldSnapshotControlData *oldSnapshotControl;
-
-#endif
diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h
index 980d37a1947..4dc94e7ec98 100644
--- a/src/include/utils/snapmgr.h
+++ b/src/include/utils/snapmgr.h
@@ -19,40 +19,6 @@
#include "utils/snapshot.h"
-/*
- * The structure used to map times to TransactionId values for the "snapshot
- * too old" feature must have a few entries at the tail to hold old values;
- * otherwise the lookup will often fail and the expected early pruning or
- * vacuum will not usually occur. It is best if this padding is for a number
- * of minutes greater than a thread would normally be stalled, but it's OK if
- * early vacuum opportunities are occasionally missed, so there's no need to
- * use an extreme value or get too fancy. 10 minutes seems plenty.
- */
-#define OLD_SNAPSHOT_PADDING_ENTRIES 10
-#define OLD_SNAPSHOT_TIME_MAP_ENTRIES (old_snapshot_threshold + OLD_SNAPSHOT_PADDING_ENTRIES)
-
-/*
- * Common definition of relation properties that allow early pruning/vacuuming
- * when old_snapshot_threshold >= 0.
- */
-#define RelationAllowsEarlyPruning(rel) \
-( \
- RelationIsPermanent(rel) && !IsCatalogRelation(rel) \
- && !RelationIsAccessibleInLogicalDecoding(rel) \
-)
-
-#define EarlyPruningEnabled(rel) (old_snapshot_threshold >= 0 && RelationAllowsEarlyPruning(rel))
-
-/* GUC variables */
-extern PGDLLIMPORT int old_snapshot_threshold;
-
-
-extern Size SnapMgrShmemSize(void);
-extern void SnapMgrInit(void);
-extern TimestampTz GetSnapshotCurrentTimestamp(void);
-extern TimestampTz GetOldSnapshotThresholdTimestamp(void);
-extern void SnapshotTooOldMagicForTest(void);
-
extern PGDLLIMPORT bool FirstSnapshotSet;
extern PGDLLIMPORT TransactionId TransactionXmin;
@@ -97,14 +63,6 @@ extern PGDLLIMPORT SnapshotData CatalogSnapshotData;
((snapshot)->snapshot_type == SNAPSHOT_MVCC || \
(snapshot)->snapshot_type == SNAPSHOT_HISTORIC_MVCC)
-#ifndef FRONTEND
-static inline bool
-OldSnapshotThresholdActive(void)
-{
- return old_snapshot_threshold >= 0;
-}
-#endif
-
extern Snapshot GetTransactionSnapshot(void);
extern Snapshot GetLatestSnapshot(void);
extern void SnapshotSetCommandId(CommandId curcid);
@@ -138,13 +96,6 @@ extern void DeleteAllExportedSnapshotFiles(void);
extern void WaitForOlderSnapshots(TransactionId limitXmin, bool progress);
extern bool ThereAreNoPriorRegisteredSnapshots(void);
extern bool HaveRegisteredOrActiveSnapshot(void);
-extern bool TransactionIdLimitedForOldSnapshots(TransactionId recentXmin,
- Relation relation,
- TransactionId *limit_xid,
- TimestampTz *limit_ts);
-extern void SetOldSnapshotThresholdTimestamp(TimestampTz ts, TransactionId xlimit);
-extern void MaintainOldSnapshotTimeMapping(TimestampTz whenTaken,
- TransactionId xmin);
extern char *ExportSnapshot(Snapshot snapshot);