pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Update TransactionXmin when MyProc->xmin is updated
Date: Sat, 21 Dec 2024 22:11:44 +0000
Message-ID: <E1tP7hI-000glu-3t@gemulon.postgresql.org> (raw)

Update TransactionXmin when MyProc->xmin is updated

GetSnapshotData() set TransactionXmin = MyProc->xmin, but when
SnapshotResetXmin() advanced MyProc->xmin, it did not advance
TransactionXmin correspondingly. That meant that TransactionXmin could
be older than MyProc->xmin, and XIDs between than TransactionXmin and
the real MyProc->xmin could be vacuumed away. One known consequence is
in pg_subtrans lookups: we might try to look up the status of an XID
that was already truncated away.

Back-patch to all supported versions.

Reviewed-by: Andres Freund
Discussion: https://www.postgresql.org/message-id/d27a046d-a1e4-47d1-a95c-fbabe41debb4@iki.fi

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/41eafbb494c9578fa04ffa529a10e4cfd6942421

Modified Files
--------------
src/backend/utils/time/snapmgr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1tP7hI-000glu-3t@gemulon.postgresql.org>
Permalink:  ../E1tP7hI-000glu-3t@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tP7hI-000glu-3t@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: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Update TransactionXmin when MyProc->xmin is updated
  In-Reply-To: <E1tP7hI-000glu-3t@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