| From: | Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Update TransactionXmin when MyProc->xmin is updated |
| Date: | 2024-12-21 22:11:44 |
| Message-ID: | E1tP7hI-000gls-3Q@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
------
REL_15_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/acd5c28db5d0cdb9446c5cb09996629f78287b82
Modified Files
--------------
src/backend/utils/time/snapmgr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Paquier | 2024-12-23 03:49:15 | pgsql: Fix memory leak in pgoutput with publication list cache |
| Previous Message | David Rowley | 2024-12-20 20:43:48 | pgsql: Optimize alignment calculations in tuple form/deform |