Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sf19w-000CWM-G2 for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Aug 2024 17:54:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sf19u-006w6X-QF for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Aug 2024 17:54:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sf19t-006w6N-Tq for pgsql-bugs@lists.postgresql.org; Fri, 16 Aug 2024 17:54:42 +0000 Received: from fout4-smtp.messagingengine.com ([103.168.172.147]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sf19p-005D7H-SV for pgsql-bugs@lists.postgresql.org; Fri, 16 Aug 2024 17:54:40 +0000 Received: from phl-compute-02.internal (phl-compute-02.nyi.internal [10.202.2.42]) by mailfout.nyi.internal (Postfix) with ESMTP id 9A4E5138FCAB; Fri, 16 Aug 2024 13:54:35 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Fri, 16 Aug 2024 13:54:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1723830875; x= 1723917275; bh=TUk7eXcUTKRhjJ6ssD4+7GFhEgiQPtC1o0Nhr2DaZmc=; b=J wQ8NYGMywltxD8ARcAroD/D5/92Ny6YmhyQHcJRjt8UiYByybwoOATscdaRtwbl3 3RgzKoyYNaWOTz9j/MrCFr9uYv+wR24MSw2nIvlF6V7LbMSNshOV02Gc6TBqDQda Mkg99SEvgeB6WL+9Zj9X43iJIYrEm2bGtNOyo3e0Sh/9ZuwYBcHXHWqj0zAHSk+v IEALPcwfnREvTKWCwvNSfNGg6BFtEV/dF49fldnTp+fuIsKsNLMEe8hUNV7FY9WQ aG93boByQZqzYb+19dlNkkvYqvLwYbYdzwFfLMQ6SAoqPXL2FqxSmryUAF60LWLU E9QWavGCY5zj0M2Bw9afg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddtkedgudduiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvf evuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgrrhhoucfjvghrrhgv rhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrth htvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeekfffgudffhfduffff ueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhgpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehmsggrrdhoghholhhnhiesghhmrghilhdrtghomhdprhgtphht thhopehpghhsqhhlqdgsuhhgsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 16 Aug 2024 13:54:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1723830871; bh=BTLi6moh/0jSkPCyRO4XAAbHVrVTFpqw1aXhK5gbV9s=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=TseUeu9+MZdAm5TzFzhVRvxwYAbIWnIt1iAxAMsYl0jerG1YEb9hjuwTjp5Yra1nh kMy3xLMqslnl3uePm5jKSaD5ZBOVgiH5G32Ow38+lis1uRhjmuT96Y1raml4xct57g REdR4CLRKmFR5nBZ3ULGO1fxCn37jHS7dJJwqsJP9YLfQ1TSt+O1I6r6OzAdDcgu4x C3CXdNOLjdziUdiVsRI7FtjK/ePZ+Urkj2n0S/p6U/P6gM4HeA6K9DMnC6OVUgs92T HwZHFlCogie9rldL6LDMu4KFphW3kePoM5+hRCx/0/0bRoXq2PIYCSuMXH799KMv1X mOFhLIERnR+Vg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 5EDC7E9; Fri, 16 Aug 2024 13:54:31 -0400 (-04) Date: Fri, 16 Aug 2024 13:54:31 -0400 From: Alvaro Herrera To: Marcin =?utf-8?Q?Barczy=C5=84ski?= Cc: pgsql-bugs@lists.postgresql.org Subject: Re: REINDEX INDEX pg_catalog.pg_default_acl_role_nsp_obj_index stuck waiting for transaction from the future in PG 13.16 Message-ID: <202408161754.vjfyvlkgu3su@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 2024-Aug-16, Marcin Barczyński wrote: > REINDEX INDEX pg_catalog.pg_default_acl_role_nsp_obj_index got stuck > waiting for a transaction from the future in PG 13.16. Below is some > additional data that I was able to gather. Hmm, that's odd. > #3 XactLockTableWait (xid=2004, rel=, ctid= out>, oper=XLTW_InsertIndexUnique) at storage/lmgr/lmgr.c:690 > #4 0x000000000054b44b in heapam_index_build_range_scan > (heapRelation=0x7f86ca209a38, indexRelation=0x7f86ca20a5f8, > indexInfo=0x10cd008, allow_sync=, anyvisible=false, > progress=true, > start_blockno=0, numblocks=4294967295, callback=0x568530 > <_bt_build_callback>, callback_state=0x7fffd823c3b0, scan=0x10ca408) > at access/heap/heapam_handler.c:1552 This means it wants to wait for transaction with xid=2004 for some reason. But why? Line 1552 in heapam_handler.c in 13.16 is inside the HEAPTUPLE_DELETE_IN_PROGRESS case of HeapTupleSatisfiesVacuum, and the xwait has been obtained by HeapTupleHeaderGetUpdateXid. The three distinct t_infomask values in the page you should are 0x0502, 0x2102, 0x2502; neither of them has HEAP_XMAX_IS_MULTI set (0x1000), which means the value must be a literal value in the t_xmax field, and there's no such value in the page you show. So something does not square here. Also, the ip_posid value says to look for a tuple with lp=13, but there's no such per pageinspect. I think you have get_raw_page'd the wrong page. Maybe do a "bt full" in gdb to see the values of the locals. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/