postgresql/src/backend
Peter Geoghegan 4ce3afb82e Refactor how VACUUM passes around its XID cutoffs.
Use a dedicated struct for the XID/MXID cutoffs used by VACUUM, such as
FreezeLimit and OldestXmin.  This state is initialized in vacuum.c, and
then passed around by code from vacuumlazy.c to heapam.c freezing
related routines.  The new convention is that everybody works off of the
same cutoff state, which is passed around via pointers to const.

Also simplify some of the logic for dealing with frozen xmin in
heap_prepare_freeze_tuple: add dedicated "xmin_already_frozen" state to
clearly distinguish xmin XIDs that we're going to freeze from those that
were already frozen from before.  That way the routine's xmin handling
code is symmetrical with the existing xmax handling code.  This is
preparation for an upcoming commit that will add page level freezing.

Also refactor the control flow within FreezeMultiXactId(), while adding
stricter sanity checks.  We now test OldestXmin directly, instead of
using FreezeLimit as an inexact proxy for OldestXmin.  This is further
preparation for the page level freezing work, which will make the
function's caller cede control of page level freezing to the function
where appropriate (where heap_prepare_freeze_tuple sees a tuple that
happens to contain a MultiXactId in its xmax).

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: Jeff Davis <pgsql@j-davis.com>
Discussion: https://postgr.es/m/CAH2-WznS9TxXmz2_=SY+SyJyDFbiOftKofM9=aDo68BbXNBUMA@mail.gmail.com
2022-12-22 09:37:59 -08:00
..
access Refactor how VACUUM passes around its XID cutoffs. 2022-12-22 09:37:59 -08:00
backup Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
bootstrap Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
catalog Remove dead code 2022-12-22 08:12:41 +01:00
commands Refactor how VACUUM passes around its XID cutoffs. 2022-12-22 09:37:59 -08:00
executor Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
foreign Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
jit Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
lib Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
libpq Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
main Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
nodes Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
optimizer Avoid O(N^2) cost when pulling up lots of UNION ALL subqueries. 2022-12-22 11:02:03 -05:00
parser Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
partitioning Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
po Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
port Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
postmaster Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
regex Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
replication Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
rewrite Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
snowball Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
statistics Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
storage Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
tcop Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
tsearch Switch some system functions to use get_call_result_type() 2022-12-21 10:11:22 +09:00
utils Add palloc_aligned() to allow aligned memory allocations 2022-12-22 13:32:05 +13:00
.gitignore
Makefile autoconf: Move export_dynamic determination to configure 2022-12-06 18:55:28 -08:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
meson.build Add copyright notices to meson files 2022-12-20 07:54:39 -05:00
nls.mk NLS: Put list of available languages into LINGUAS files 2022-07-13 08:19:17 +02:00