pgsql: WAL-log inplace update before revealing it to other sessions. - Mailing list pgsql-committers

From Noah Misch
Subject pgsql: WAL-log inplace update before revealing it to other sessions.
Date
Msg-id E1t4KjF-002ON6-8E@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
WAL-log inplace update before revealing it to other sessions.

A buffer lock won't stop a reader having already checked tuple
visibility.  If a vac_update_datfrozenid() and then a crash happened
during inplace update of a relfrozenxid value, datfrozenxid could
overtake relfrozenxid.  That could lead to "could not access status of
transaction" errors.  Back-patch to v12 (all supported versions).  In
v14 and earlier, this also back-patches the assertion removal from
commit 7fcf2faf9c7dd473208fd6d5565f88d7f733782b.

Discussion: https://postgr.es/m/20240620012908.92.nmisch@google.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/acf49584e2165ded5396d107961b568fe8f5f954

Modified Files
--------------
src/backend/access/heap/README.tuplock  |  4 +--
src/backend/access/heap/heapam.c        | 58 +++++++++++++++++++++++++--------
src/backend/access/transam/xloginsert.c |  2 --
3 files changed, 46 insertions(+), 18 deletions(-)


pgsql-committers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: pgsql: doc: Fix typo in pg_restore_*_stats function documentation
Next
From: Melanie Plageman
Date:
Subject: pgsql: Make table_scan_bitmap_next_block() async-friendly