]> git.ipfire.org Git - thirdparty/postgresql.git/commit
WAL-log inplace update before revealing it to other sessions.
authorNoah Misch <noah@leadboat.com>
Wed, 17 Dec 2025 00:13:54 +0000 (16:13 -0800)
committerNoah Misch <noah@leadboat.com>
Wed, 17 Dec 2025 00:13:54 +0000 (16:13 -0800)
commitd3e5d89504484d69bc41e66fc2c2346ec0da6b07
treeed03f7e7ff24b777b9b4d9338ee0f7d0e581262e
parent0f69beddea113dd1d6c5b6f6d82df577ef3c21f2
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 v14 - v17.  This is a back-patch of commits:

8e7e672cdaa6bfec85d4d5dd9be84159df23bb41
  (main change, on master, before v18 branched)
818013665259d4242ba641aad705ebe5a3e2db8e
  (defect fix, on master, before v18 branched)

It reverses commit bc6bad88572501aecaa2ac5d4bc900ac0fd457d5, my revert
of the original back-patch.

In v14, this also back-patches the assertion removal from commit
7fcf2faf9c7dd473208fd6d5565f88d7f733782b.

Discussion: https://postgr.es/m/20240620012908.92.nmisch@google.com
Backpatch-through: 14-17
src/backend/access/heap/README.tuplock
src/backend/access/heap/heapam.c
src/include/storage/proc.h