Close race condition between datfrozen and relfrozen updates.
authorNoah Misch
Mon, 29 Apr 2024 17:24:56 +0000 (10:24 -0700)
committerNoah Misch
Mon, 29 Apr 2024 17:24:59 +0000 (10:24 -0700)
commit92685c389d5416f87553bfb80205d79d5670a695
tree942af99458e5b2bae8cac6eaea0cefe33108438e
parentb19255ca66f74fe9f8d0372db7d644d0bb4d6ac9
Close race condition between datfrozen and relfrozen updates.

vac_update_datfrozenxid() did multiple loads of relfrozenxid and
relminmxid from buffer memory, and it assumed each would get the same
value.  Not so if a concurrent vac_update_relstats() did an inplace
update.  Commit 2d2e40e3befd8b9e0d2757554537345b15fa6ea2 fixed the same
kind of bug in vac_truncate_clog().  Today's bug could cause the
rel-level field and XIDs in the rel's rows to precede the db-level
field.  A cluster having such values should VACUUM affected tables.
Back-patch to v12 (all supported versions).

Discussion: https://postgr.es/m/20240423003956[email protected]
src/backend/commands/vacuum.c