summaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xact.c
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2024-11-02 09:05:00 -0700
committerNoah Misch <noah@leadboat.com>2024-11-02 09:05:08 -0700
commit4b0f7d6c162e9a52e5c2bf1098d4ffd0b107425c (patch)
treed9bba9e1e83767d2f26185f61d2eff0fffa78599 /src/backend/access/transam/xact.c
parent5e503e10d13ef7987a5b44b2c463a5d1bf5fd103 (diff)
Revert "For inplace update, send nontransactional invalidations."
This reverts commit 95c5acb3fc261067ab65ddc0b2dca8e162f09442 (v17) and counterparts in each other non-master branch. If released, that commit would have caused a worst-in-years minor release regression, via undetected LWLock self-deadlock. This commit and its self-deadlock fix warrant more bake time in the master branch. Reported by Alexander Lakhin. Discussion: https://postgr.es/m/10ec0bc3-5933-1189-6bb8-5dec4114558e@gmail.com
Diffstat (limited to 'src/backend/access/transam/xact.c')
-rw-r--r--src/backend/access/transam/xact.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 54f1058da31..12854dfad84 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -1247,24 +1247,14 @@ RecordTransactionCommit(void)
/*
* Transactions without an assigned xid can contain invalidation
- * messages. While inplace updates do this, this is not known to be
- * necessary; see comment at inplace CacheInvalidateHeapTuple().
- * Extensions might still rely on this capability, and standbys may
- * need to process those invals. We can't emit a commit record
- * without an xid, and we don't want to force assigning an xid,
- * because that'd be problematic for e.g. vacuum. Hence we emit a
- * bespoke record for the invalidations. We don't want to use that in
- * case a commit record is emitted, so they happen synchronously with
- * commits (besides not wanting to emit more WAL records).
- *
- * XXX Every known use of this capability is a defect. Since an XID
- * isn't controlling visibility of the change that prompted invals,
- * other sessions need the inval even if this transactions aborts.
- *
- * ON COMMIT DELETE ROWS does a nontransactional index_build(), which
- * queues a relcache inval, including in transactions without an xid
- * that had read the (empty) table. Standbys don't need any ON COMMIT
- * DELETE ROWS invals, but we've not done the work to withhold them.
+ * messages (e.g. explicit relcache invalidations or catcache
+ * invalidations for inplace updates); standbys need to process those.
+ * We can't emit a commit record without an xid, and we don't want to
+ * force assigning an xid, because that'd be problematic for e.g.
+ * vacuum. Hence we emit a bespoke record for the invalidations. We
+ * don't want to use that in case a commit record is emitted, so they
+ * happen synchronously with commits (besides not wanting to emit more
+ * WAL records).
*/
if (nmsgs != 0)
{