Hi, On Wed, Apr 1, 2026 at 2:21 PM Bharath Rupireddy <[email protected]> wrote: > > On Wed, Apr 1, 2026 at 12:39 PM Masahiko Sawada <[email protected]> wrote: > > > > I've reviewed the v7 patch and have some review comments: > > Thank you for reviewing the patch. > > I took the above changes into v8 and fixed a typo in using xidLimit > instead of slotXidLimit. > > Please find the attached v8 patches for further review. Thank you!
Thank you, Sawada-san, for reviewing and providing some offlist comments. 1/ Included a note in the docs to say that logical replication slots are also affected by XID age GUC (similar to idle_replication_slot_timeout). 2/ Added the code to disable the XID age invalidation in pg_createsubscriber similar to timeout invalidation. Commit 72e6c08fea ensured that none of the logical replication slots get invalidated during the upgrade. (I believe the work that pg_upgrade and pg_createsubscriber do is more important, and the slots created and used by them or slots in use during those processes must not interfere with the upgrade or creating a logical replica from a standby.) 3/ Changed the max value of XID age GUC to be equal to that of vacuum failsafe age. In my opinion, the best use of max_slot_xid_age would be to set it equal to or a little less than vacuum_failsafe_age. Also added a note in the docs about this. 4/ Changed variable names for consistency. 5/ Added code to MaybeInvalidateXIDAgedSlots() to skip the slot invalidation attempt (unnecessary work) when slots are not the reason for holding back the OldestXmin. Added an equality check to see if OldestXmin is either OldestSlotXmin or OldestSlotCatalogXmin (all these OldestXXXXmins are computed from the same ComputeXidHorizons() call). This should allow us to skip the slot invalidation attempt when a backend is holding the xmin back (a long-running transaction, for example). Please find the attached v9 patches for further review. Thank you! -- Bharath Rupireddy Amazon Web Services: https://aws.amazon.com
v9-0001-Add-XID-age-based-replication-slot-invalidation.patch
Description: Binary data
v9-0002-Add-more-tests-for-XID-age-slot-invalidation.patch
Description: Binary data
