Remove remants of "snapshot too old"
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 9 Dec 2024 16:13:03 +0000 (18:13 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 9 Dec 2024 16:13:03 +0000 (18:13 +0200)
commit4d8275046c36792afb3604677c0a53c8530388ae
treeaf6d2e812ed839329c9582720ff5adb404936c26
parentf64ec81a810ebd4649beb6c153844fa9ae1ecffe
Remove remants of "snapshot too old"

Remove the 'whenTaken' and 'lsn' fields from SnapshotData. After the
removal of the "snapshot too old" feature, they were never set to a
non-zero value.

This largely reverts commit 3e2f3c2e423, which added the
OldestActiveSnapshot tracking, and the init_toast_snapshot()
function. That was only required for setting the 'whenTaken' and 'lsn'
fields. SnapshotToast is now a constant again, like SnapshotSelf and
SnapshotAny. I kept a thin get_toast_snapshot() wrapper around
SnapshotToast though, to check that you have a registered or active
snapshot. That's still a useful sanity check.

Reviewed-by: Nathan Bossart, Andres Freund, Tom Lane
Discussion: https://www.postgresql.org/message-id/cd4b4f8c-e63a-41c0-95f6-6e6cd9b83f6d@iki.fi
contrib/amcheck/verify_heapam.c
src/backend/access/common/toast_internals.c
src/backend/access/heap/heaptoast.c
src/backend/storage/ipc/procarray.c
src/backend/utils/time/snapmgr.c
src/include/access/genam.h
src/include/access/toast_internals.h
src/include/storage/predicate.h
src/include/utils/snapmgr.h
src/include/utils/snapshot.h