Skip to content

Commit

Permalink
PG16: vacuum_set_xid_limits is now vacuum_get_cutoffs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lkshminarayanan committed Aug 17, 2023
1 parent f92cab8 commit beb3b39
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/compat/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand All @@ -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, &params, &cutoffs); \
*(oldestXmin) = cutoffs.OldestXmin; \
*(freezeLimit) = cutoffs.FreezeLimit; \
*(multiXactCutoff) = cutoffs.MultiXactCutoff; \
} while (0)
#endif

#if PG15_LT
Expand Down

0 comments on commit beb3b39

Please sign in to comment.