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 1n6w2S-0003tl-IJ for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jan 2022 14:52:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n6w2R-00021v-1Z for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jan 2022 14:52:47 +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 1n6w2Q-00021l-0c for pgsql-hackers@lists.postgresql.org; Mon, 10 Jan 2022 14:52:46 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n6w2M-0000DF-BI for pgsql-hackers@lists.postgresql.org; Mon, 10 Jan 2022 14:52:45 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 18DEB5C00C1; Mon, 10 Jan 2022 09:52:39 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 10 Jan 2022 09:52:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=/lRaUL1RvmbOq/qNlHcf4PD1gDtbrhjIga+p0wkINsw=; b=b9A33+76 sc5x0MvGxPwIYtJjb1zOct41evCN3hYcRBDESm9WE3jrag5Nrmssyhl3HsNKpuhK XKeoOkLDals2d2b2nCL1QreXBgXFcqw1FzNLmJFLX97X9CJqFhHneXhe+mW3S43m uCYY4AunvAvtdqMinbU+PmwZzcCbR+nWOmrMTWU+YvSObain5ze9cYVh25VsX7Um AvYJJsbygQgBrfxlz7xflljsgy5MLkvAVTEsUif3x2O+qkg8L4nHdjCq+d9vz8f8 6n8p18h8ycwQzmQWzO7u8HpbWOuRtdax0y+7A+7QcEMly7wxznN70LJywypbsOTq OI3n/jUjWGbqVg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudehuddggeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedujeevjeffjeevuddutedvkeeiueeitddvieelfeekveej udefgeeuvdejhfeuleenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 10 Jan 2022 09:52:38 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 989BC2A07F0; Mon, 10 Jan 2022 11:52:35 -0300 (-03) Date: Mon, 10 Jan 2022 11:52:35 -0300 From: Alvaro Herrera To: Andrey Borodin Cc: Pg Hackers Subject: Re: reporting TID/table with corruption error Message-ID: <202201101452.csmmhfm63l5f@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Jan-10, Andrey Borodin wrote: > 3. The tuple seems to be updated in a high-contention concurrency > trigger function, autovacuum keeks in ~20-30 seconds after the message > in logs Hmm, I bet this is related. > [ 2022-01-10 09:07:17.671 MSK [unknown],????,????_????s,310759,XX001 ]:ERROR: t_xmin 696079792 is uncommitted in tuple (1419011,109) to be updated in table "????s_statistics" > [ 2022-01-10 09:07:17.671 MSK [unknown],????,????_????s,310759,XX001 ]:CONTEXT: SQL statement "UPDATE ????_????s.????s_statistics os > SET ????_????_found_ts = COALESCE(os.????_????_found_ts, NOW()), > last_????_found_ts = NOW(), > num_????s = os.num_????s + 1 > WHERE ????_id = NEW.????_id" > PL/pgSQL function statistics__update_from_new_????() line 3 at SQL statement > [ 2022-01-10 09:07:17.671 MSK [unknown],????,????_????s,310759,XX001 ]:STATEMENT: > INSERT INTO ????_????s.????s_????s AS ????s > > 4. t_xmin is relatevely new, not ancient > 5. pageinspect shows dead tuple after some time > 6. no suspicious activity in logs nearby > 7. vacuum (disable_page_skipping) and repack of indexes did not change anything > > > I suspect this can be relatively new concurrency stuff. At least I never saw this before on clusters with clean amcheck and heapcheck results. Ah. I've been thinking that it'd be some very old tuple that is in trouble, but that seems to be proven false. I think we should examine the affected tuples more closely while they're in the state that causes the problem. Can you set up things so that pageinspect's heap_page_items() is run on the broken page, before the problem disappears? Maybe extract the page number from the log line, have get_raw_page() store the page in a separate table, so that we can run heap_page_items() at leisure later. I would also grep through pg_waldump output to see what changes have been done to that tuple. Maybe the reason the problem fixes itself is that something else deletes the tuple. > Alvaro, did you observe this on binaries from August 13 minor release or older? Well, the only reports I have of this problem are with the original error message that didn't give any clues at to what the problem was or where to look for it, so I don't know if the xmin was recent or not. -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/