WAL-log inplace update before revealing it to other sessions.
Noah Misch <noah@leadboat.com>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/heap/heapam.c | modified | +45 −13 |
| src/backend/access/heap/README.tuplock | modified | +1 −3 |
| src/backend/access/transam/xloginsert.c | modified | +0 −2 |
Discussion
- datfrozenxid > relfrozenxid w/ crash before XLOG_HEAP_INPLACE 5 messages · 2024-06-20 → 2025-04-13