pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Close race condition between datfrozen and relfrozen updates.
Date: Mon, 29 Apr 2024 17:30:41 +0000
Message-ID: <E1s1Upr-000eAN-VT@gemulon.postgresql.org> (raw)

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_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/70cadfba0c70b25922d0739a9e09d24f0efd7f46

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



view thread (7+ messages)  latest in thread

Message-ID: <E1s1Upr-000eAN-VT@gemulon.postgresql.org>
Permalink:  ../E1s1Upr-000eAN-VT@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1s1Upr-000eAN-VT@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Close race condition between datfrozen and relfrozen updates.
  In-Reply-To: <E1s1Upr-000eAN-VT@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox