summaryrefslogtreecommitdiff
path: root/src/include/access/tableam.h
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2025-01-25 11:28:14 -0800
committerNoah Misch <noah@leadboat.com>2025-01-25 11:28:19 -0800
commit25e99483c4116313b678cc94df53d3ea28977752 (patch)
treefaad3e59f6d02b27387492024628519a4c687466 /src/include/access/tableam.h
parent7b3259bd7cf37da472ff5c2ce25fe0aa552e6fe0 (diff)
At update of non-LP_NORMAL TID, fail instead of corrupting page header.
The right mix of DDL and VACUUM could corrupt a catalog page header such that PageIsVerified() durably fails, requiring a restore from backup. This affects only catalogs that both have a syscache and have DDL code that uses syscache tuples to construct updates. One of the test permutations shows a variant not yet fixed. This makes !TransactionIdIsValid(TM_FailureData.xmax) possible with TM_Deleted. I think core and PGXN are indifferent to that. Per bug #17821 from Alexander Lakhin. Back-patch to v13 (all supported versions). The test case is v17+, since it uses INJECTION_POINT. Discussion: https://postgr.es/m/17821-dd8c334263399284@postgresql.org
Diffstat (limited to 'src/include/access/tableam.h')
-rw-r--r--src/include/access/tableam.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/access/tableam.h b/src/include/access/tableam.h
index 7465f037860..f1e6f554aa7 100644
--- a/src/include/access/tableam.h
+++ b/src/include/access/tableam.h
@@ -113,7 +113,8 @@ typedef enum TM_Result
*
* xmax is the outdating transaction's XID. If the caller wants to visit the
* replacement tuple, it must check that this matches before believing the
- * replacement is really a match.
+ * replacement is really a match. This is InvalidTransactionId if the target
+ * was !LP_NORMAL (expected only for a TID retrieved from syscache).
*
* cmax is the outdating command's CID, but only when the failure code is
* TM_SelfModified (i.e., something in the current transaction outdated the