Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGl3V-0008HA-3P for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Aug 2021 16:38:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mGl3U-0001Vg-1X for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Aug 2021 16:38:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGl3T-0001VY-Q0 for pgsql-hackers@lists.postgresql.org; Thu, 19 Aug 2021 16:38:11 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGl3Q-0003J6-EN for pgsql-hackers@lists.postgresql.org; Thu, 19 Aug 2021 16:38:11 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 888783200987 for ; Thu, 19 Aug 2021 12:38:03 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 19 Aug 2021 12:38:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=mOnSMn SZncgeYkW+wwCvEdOr421Pe2vi6j/QOhQTUBM=; b=O6Pw9uW1yqq6AGKqPoZdRK rAd/mhtLOPcfLyGZ79kRVtLGkzceAy+hh0FLCVcnLpLm23MAUtsyJthcDOz2Wvcz zrJulKBdFdK+BU8C9wP+D4gHcDA9XH7SfsYELaJ2jhfWRZWGKHvKsslyjdwZ+s9V 5n6BW6sY/dE5kRepybLb0P4VxO4gOpGMvwNBWk1rqUoJ57r58rLPW3XXzqfVmyuV wo8EHh2YwakFjbpcz9DallNRxtcFkd6PNwBC5nbJPVkeTc1JfuyAe/PIFmJrRIbq tQQTH7ZVhoMMH8L/02AuZ7ew5ypDskOrJ6dlvAFz3GYD5AoK44Xy/SVgp/EvHy5g == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfesmhekreertddtjeenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqne cuggftrfgrthhtvghrnhepgeelueeigfdulefgtddvveejueffieeigedttdeuveejhedt ieevueehvdfhteefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 19 Aug 2021 12:38:02 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 95C442A062A; Thu, 19 Aug 2021 12:37:58 -0400 (-04) Date: Thu, 19 Aug 2021 12:37:58 -0400 From: Alvaro Herrera To: Pg Hackers Subject: reporting TID/table with corruption error Message-ID: <202108191637.oqyzrdtnheir@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="noofub6pisklu2cx" Content-Disposition: inline Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --noofub6pisklu2cx Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit A customer recently hit this error message: ERROR: t_xmin is uncommitted in tuple to be updated This was not very informative, so without any clues, we had to let it go. But it did occur to me that we can improve this message so that we know details such as the TID and the relation that caused the issue, so that if it ever occurs again we can at least look at the WAL stream for anything affecting the tuple, maybe it'd help to understand the problem. So I propose the following patch. -- Álvaro Herrera --noofub6pisklu2cx Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="report-tuple.patch" diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index beb8f20708..9befe012a9 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -424,7 +424,11 @@ tuple_lock_retry: if (TransactionIdIsValid(SnapshotDirty.xmin)) ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), - errmsg_internal("t_xmin is uncommitted in tuple to be updated"))); + errmsg_internal("t_xmin %u is uncommitted in tuple (%u,%u) to be updated in table \"%s\"", + SnapshotDirty.xmin, + ItemPointerGetBlockNumber(&tuple->t_self), + ItemPointerGetOffsetNumber(&tuple->t_self), + RelationGetRelationName(relation)))); /* * If tuple is being updated by other transaction then we --noofub6pisklu2cx--