Assert in init_toast_snapshot() that some snapshot registered or active.
authorAndres Freund <[email protected]>
Sat, 19 Feb 2022 20:42:37 +0000 (12:42 -0800)
committerAndres Freund <[email protected]>
Mon, 21 Feb 2022 16:58:29 +0000 (08:58 -0800)
commit2776922201f751e3202a713b61d97fe4e44a8440
treee8778f6c653fa5c738b4c2bd12b725799a110f00
parent7c38ef2a5d6cf6d8dc3834399d7a1c364d64ce64
Assert in init_toast_snapshot() that some snapshot registered or active.

Commit <FIXME> fixed the bug that RemoveTempRelationsCallback() did not
push/register a snapshot. That only went unnoticed because often a valid
catalog snapshot exists and is returned by GetOldestSnapshot(). But due to
invalidation processing that is not reliable.

Thus assert in init_toast_snapshot() that there is a registered or active
snapshot, using the new HaveRegisteredOrActiveSnapshot().

Author: Andres Freund
Discussion: https://postgr.es/m/20220219180002[email protected]
src/backend/access/common/toast_internals.c
src/backend/utils/time/snapmgr.c
src/include/utils/snapmgr.h