/* * XXX: This one combined record type replaces existing * XLOG_HEAP2_PRUNE, XLOG_HEAP2_VACUUM, and XLOG_HEAP2_FREEZE_PAGE record types */ /* * This is what we need to know about page pruning and freezing, both during * VACUUM and during opportunistic pruning. * * If XLPH_HAS_REDIRECTIONS, XLHP_HAS_DEAD_ITEMS or XLHP_HAS_FREEZE_PLANS is * set, acquires a full cleanup lock. Otherwise an ordinary exclusive lock is * enough (VACUUM's second heap pass generates such records). * * The data for block reference 0 contains "sub-records" depending on which * of the XLPH_HAS_* flags are set. See xlhp_* struct definitions below. */ typedef struct xl_heap_prune { TransactionId snapshotConflictHorizon; uint8 flags; } xl_heap_prune; #define XLHP_IS_CATALOG_REL 0x01 /* to handle recovery conflict during logical * decoding on standby */ #define XLHP_HAS_REDIRECTIONS 0x02 #define XLHP_HAS_DEAD_ITEMS 0x04 #define XLHP_HAS_NOW_UNUSED_ITEMS 0x08 #define XLHP_HAS_FREEZE_PLANS 0x10 #define SizeOfHeapPrune (offsetof(xl_heap_prune, flags) + sizeof(uint8)) /* * Sub-record contained in block reference 0 of a prune record if * XLHP_HAS_REDIRECTIONS is set */ typedef struct xl_heap_prune_redirections { uint16 nitems; struct { OffsetNumber from; OffsetNumber to; } items[FLEXIBLE_ARRAY_MEMBER]; } xl_heap_prune_redirections; /* * Sub-record contained in block reference 0 of a prune record if * XLHP_HAS_DEAD_ITEMS is set */ typedef struct xlhp_dead_items { uint16 nitems; OffsetNumber items[FLEXIBLE_ARRAY_MEMBER]; } xlhp_dead_items; /* * Sub-record contained in block reference 0 of a prune record if * XLHP_HAS_NOW_UNUSED_ITEMS is set */ typedef struct xlhp_now_unused_items { uint16 nitems; OffsetNumber items[FLEXIBLE_ARRAY_MEMBER]; } xlhp_now_unused_items; /* * This struct represents a 'freeze plan', which describes how to freeze a * group of one or more heap tuples (appears in xlhp_freeze sub-record) */ #define XLH_FREEZE_XVAC 0x02 #define XLH_INVALID_XVAC 0x04 typedef struct xlhp_freeze_plan { TransactionId xmax; uint16 t_infomask2; uint16 t_infomask; uint8 frzflags; /* Length of individual page offset numbers array for this plan */ uint16 ntuples; OffsetNumber items[FLEXIBLE_ARRAY_MEMBER]; } xlhp_freeze_plan; /* * This is what we need to know about a block being frozen during vacuum * * Backup block 0's data contains an array of xl_heap_freeze_plan structs * (with nplans elements), followed by one or more page offset number arrays. * Each such page offset number array corresponds to a single freeze plan * (REDO routine freezes corresponding heap tuples using freeze plan). */ typedef struct xlhp_freeze { uint16 nplans; /* xlhp_freeze_plan structs follow */ } xlhp_freeze;