From beb3b39599940082a7b0f4bf0d1d76e4500e5ebb Mon Sep 17 00:00:00 2001 From: Lakshmi Narayanan Sreethar Date: Thu, 1 Jun 2023 23:01:46 +0530 Subject: [PATCH] PG16: vacuum_set_xid_limits is now vacuum_get_cutoffs PG16 refactors how VACUUM passes around its XID cutoffs. A new dedicated struct is now used by VACUUM to maintain the XID/MXID cutoffs such as FreezeLimit and OldestXmin. The vacuum_set_xid_limits() function is also now replaced with a a new vacuum_get_cutoffs() function that uses the new struct. postgres/postgres@4ce3afb8 --- src/compat/compat.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/compat/compat.h b/src/compat/compat.h index 846a8c04a..16c1ceb0f 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -585,7 +585,7 @@ pg_strtoint64(const char *str) NULL, \ multiXactCutoff, \ NULL) -#else +#elif PG16_LT #define vacuum_set_xid_limits_compat(rel, \ freeze_min_age, \ freeze_table_age, \ @@ -607,6 +607,28 @@ pg_strtoint64(const char *str) freezeLimit, \ multiXactCutoff); \ } while (0) +#else +#define vacuum_set_xid_limits_compat(rel, \ + freezeMinAge, \ + freezeTableAge, \ + multixactFreezeMinAge, \ + multixactFreezeTableAge, \ + oldestXmin, \ + freezeLimit, \ + multiXactCutoff) \ + do \ + { \ + struct VacuumCutoffs cutoffs; \ + /* vacuum_get_cutoffs uses only the *_age members of the VacuumParams object */ \ + VacuumParams params = { .freeze_min_age = freezeMinAge, \ + .freeze_table_age = freezeTableAge, \ + .multixact_freeze_min_age = multixactFreezeMinAge, \ + .multixact_freeze_table_age = multixactFreezeTableAge }; \ + vacuum_get_cutoffs(rel, ¶ms, &cutoffs); \ + *(oldestXmin) = cutoffs.OldestXmin; \ + *(freezeLimit) = cutoffs.FreezeLimit; \ + *(multiXactCutoff) = cutoffs.MultiXactCutoff; \ + } while (0) #endif #if PG15_LT