summaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/inval.c
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:18 -0800
commitf4af4515bb5f3591d49bc16b6cb8ddbf66f98374 (patch)
treef2faf0445b5304af6804d8f0d08362fedc7fc38a /src/backend/utils/cache/inval.c
parent1587f7b9fc1a16df8b01b4f5f9e3c949325160b2 (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/backend/utils/cache/inval.c')
-rw-r--r--src/backend/utils/cache/inval.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index 6772db24b50..3ce4775b829 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -119,6 +119,7 @@
#include "storage/sinval.h"
#include "storage/smgr.h"
#include "utils/catcache.h"
+#include "utils/injection_point.h"
#include "utils/inval.h"
#include "utils/memdebug.h"
#include "utils/memutils.h"
@@ -1031,6 +1032,8 @@ AtEOXact_Inval(bool isCommit)
/* Must be at top of stack */
Assert(transInvalInfo->my_level == 1 && transInvalInfo->parent == NULL);
+ INJECTION_POINT("AtEOXact_Inval-with-transInvalInfo");
+
if (isCommit)
{
/*