aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2023-03-28 16:16:53 -0400
committerRobert Haas <rhaas@postgresql.org>2023-03-28 16:16:53 -0400
commitb7cea58822c67724effc711ae28e4077a01a7cd6 (patch)
tree54ae65811fe83203f657bb34e67ac7f54b464606
parentbade01cb4dd88f63bd9024cfdaec3d5001a805f3 (diff)
downloadpostgresql-b7cea58822c67724effc711ae28e4077a01a7cd6.tar.gz
postgresql-b7cea58822c67724effc711ae28e4077a01a7cd6.zip
amcheck: In verify_heapam, allows tuples with xmin 0.
Commit e88754a1965c0f40a723e6e46d670cacda9e19bd caused that case to be reported as corruption, but Peter Geoghegan pointed out that it can legitimately happen in the case of a speculative insertion that aborts, so we'd better not flag it as corruption after all. Back-patch to v14, like the commit that introduced the issue. Discussion: http://postgr.es/m/CAH2-WzmEabzcPTxSY-NXKH6Qt3FkAPYHGQSe2PtvGgj17ZQkCw@mail.gmail.com
-rw-r--r--contrib/amcheck/verify_heapam.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/contrib/amcheck/verify_heapam.c b/contrib/amcheck/verify_heapam.c
index ce3114f4e6c..f50ee9d29f7 100644
--- a/contrib/amcheck/verify_heapam.c
+++ b/contrib/amcheck/verify_heapam.c
@@ -1032,8 +1032,7 @@ check_tuple_visibility(HeapCheckContext *ctx, bool *xmin_commit_status_ok,
switch (get_xid_status(xmin, ctx, &xmin_status))
{
case XID_INVALID:
- report_corruption(ctx,
- pstrdup("xmin is invalid"));
+ /* Could be the result of a speculative insertion that aborted. */
return false;
case XID_BOUNDS_OK:
*xmin_commit_status_ok = true;