pgsql: Close race condition between datfrozen and relfrozen updates.

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Close race condition between datfrozen and relfrozen updates.
Date: 2024-04-29 17:30:40
Message-ID: E1s1Upr-000eAE-Ty@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.e7.nmisch@google.com

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/92685c389d5416f87553bfb80205d79d5670a695

Modified Files
--------------
src/backend/commands/vacuum.c | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2024-04-29 17:30:41 pgsql: Close race condition between datfrozen and relfrozen updates.
Previous Message Heikki Linnakangas 2024-04-29 15:14:26 pgsql: libpq: Fix error messages when server rejects SSL or GSS