pgsql: Update TransactionXmin when MyProc->xmin is updated - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Update TransactionXmin when MyProc->xmin is updated
Date
Msg-id E1tP7hI-000gll-1h@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/578a7fe7b6f8484f6d7caa2fda288abb3fe87aa0

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


pgsql-committers by date:

Previous
From: David Rowley
Date:
Subject: pgsql: Optimize alignment calculations in tuple form/deform
Next
From: Michael Paquier
Date:
Subject: pgsql: Fix memory leak in pgoutput with publication list cache