On 2020-Jul-13, Andres Freund wrote: > Hi, > > On 2020-07-13 17:12:18 -0400, Robert Haas wrote: > > 1. There's nothing to identify the tuple that has the problem, and no > > way to know how many more of them there might be. Back-patching > > b61d161c146328ae6ba9ed937862d66e5c8b035a would help with the first > > part of this. > > Not fully, I'm afraid. Afaict it doesn't currently tell you the item > pointer offset, just the block numer, right? We probably should extend > it to also include the offset...
Just having the block number is already a tremendous step forward; with that you can ask the customer to set a pageinspect dump of tuple headers, and then the problem is obvious. Now if you want to add block number to that, by all means do so. FWIW I do support the idea of backpatching the vacuum errcontext commit. One useful thing to do is to mark a tuple frozen unconditionally if it's marked hinted XMIN_COMMITTED; no need to consult pg_clog in that case. The attached (for 9.6) does that; IIRC it would have helped in a couple of cases. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>From 2d5574e4e3caa0299d27d77f0fc319463fc84162 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera <alvhe...@alvh.no-ip.org> Date: Thu, 18 Jul 2019 12:50:11 -0400 Subject: [PATCH] Don't test for xact commit if tuple is hinted --- src/backend/access/heap/heapam.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index fe3e83b489..d42bc6502c 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -6724,7 +6724,8 @@ heap_prepare_freeze_tuple(HeapTupleHeader tuple, if (TransactionIdPrecedes(xid, cutoff_xid)) { - if (!TransactionIdDidCommit(xid)) + if (!HeapTupleHeaderXminCommitted(xid) && + !TransactionIdDidCommit(xid)) ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), errmsg_internal("uncommitted xmin %u from before xid cutoff %u needs to be frozen", -- 2.20.1