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 1mgYy5-0007RQ-FM for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Oct 2021 20:59:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mgYy3-0007Mo-AJ for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Oct 2021 20:59:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgYy3-0007MX-31 for pgsql-bugs@lists.postgresql.org; Fri, 29 Oct 2021 20:59:15 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgYy1-00073B-0Z for pgsql-bugs@lists.postgresql.org; Fri, 29 Oct 2021 20:59:14 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0353E5C01D3; Fri, 29 Oct 2021 16:59:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 29 Oct 2021 16:59:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm3; bh=f nAH0KlwziGRThj+Tdd2kRIRCIPQfcz1a+rq6rkJRB8=; b=2tcrLGTLE1blmUMw0 bzGmP8VxTsCt2+1rtZG/HjRuPtYEAz1uJoFJ2LH8oPT+GaC63a+rz5rOknmu1Ccr feD8jFBLqvD2NopR6umlG3iM/lojHGReoq6seRhYMgwyxqSe6B9PvuWp3UX1tx/t glaiNYIUXc1FOIhuQHGQEv5T2X+YUGpplxtHQC8rXSEEroxGYgw82nLGNqLblMpG AJyoGB536KSJNx8XHRuQ41UYu1TX6mT6LLS85iuzc4CozX984hpxsEJp5H7azSEs DAbQpzEk8CmiR51NO3S/MX7CECX/hhCcFSSfjmiObGn1PX2JgRVpe5OipW4Wc1Ko 8HN2g== 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:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=fnAH0KlwziGRThj+Tdd2kRIRCIPQfcz1a+rq6rkJR B8=; b=excGjwEeOWPb50n1/2QaFiceivASRL8XPGNKJfihJQ0K7mx8PvvbxzGg1 sch4oaT8wWlhRRKi/VDf8hqYSOCnkr2yBb+dWqwIDnc1P8TfFpF/1XitvFkjGB3C O8b7iFfPddi0oyo5qepT05mATdBsx+hurah1I5PfV4fObpGRURabtk9qTvHeKaMJ 6e5vFmObFZvizhEXltXeubzik7TvcTl9/9sPAZDGikVRqWK5+m5XDhujnkC9HCka X9xe1xER0FfAMXlfNnJO3Pz4aQLKOneBtRF+9wCkkgXqXUeHUV+wo/Mx5kcNun5U cSJ3lqnDcpyVz/acZ5oXFN0fwxU7A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdeghedgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggugfgjsehtkeertddttddunecuhfhrohhmpeetnhgu rhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtf frrghtthgvrhhnpeejheeivdevffeijeffheegfeejveffteeviedugeegtdehffdvffek udektdehjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 29 Oct 2021 16:59:10 -0400 (EDT) Date: Fri, 29 Oct 2021 13:59:09 -0700 From: Andres Freund To: Kamigishi Rei Cc: Andrew Gierth , Alvaro Herrera , Peter Geoghegan , PostgreSQL mailing lists , Thomas Munro Subject: Re: BUG #17245: Index corruption involving deduplicated entries Message-ID: <20211029205909.ycbqxtz75srf75lu@alap3.anarazel.de> References: <202110250104.jve5vzdedck7@alvherre.pgsql> <87h7d57b3q.fsf@news-spur.riddles.org.uk> <20211028214209.kbv4ulehz36up6kq@alap3.anarazel.de> <125603c4-4403-dcbb-221e-fd1d4ef6ed83@koumakan.jp> <20211028220124.n4vulzxp6i6fsq4t@alap3.anarazel.de> <551936fa-9ba8-aed1-7ae1-c77d5920101c@koumakan.jp> <9c7433f6-65b3-9f57-e8a3-4414d0cf0c53@koumakan.jp> <399affa1-c9c5-9b3e-c14f-b24ecb86b303@koumakan.jp> <20211029204945.6hzta5dmxwtikurx@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211029204945.6hzta5dmxwtikurx@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-10-29 13:49:45 -0700, Andres Freund wrote: > > rmgr: Heap        len (rec/tot):     54/    54, tx:    2014291, lsn: > > 2/8DEC0460, prev 2/8DEC0420, desc: LOCK off 53: xid 2014291: flags 0x00 > > LOCK_ONLY EXCL_LOCK , blkref #0: rel 1663/19243/19560 blk 540 > > rmgr: Heap        len (rec/tot):     82/    82, tx:    2014291, lsn: > > 2/8DEC0498, prev 2/8DEC0460, desc: HOT_UPDATE off 53 xmax 2014291 flags 0x60 > > ; new off 41 xmax 2014291, blkref #0: rel 1663/19243/19560 blk 540 > > HOT of 540,53, now at 540,41. > > Here I am confused. 540,41 was presumably marked dead in 2/8DEC0420, but not > marked unused? So this shouldn't be possible. > > What am I missing? Oh. Likely the issue is that heap2_desc() doesn't print the number of redirects. I'm considering writing a patch that 1) displays the number of tuples marked unused in HEAP2_PRUNE. This might only be possible if no FPW was used 2) if a HEAP2_PRUNE or HEAP2_VACUUM isn't an FPW, display the offsets For 15 I think it might be worth to explicitly store the number of offets marked unused, rather than inferring that. It's hard to believe that the 16 bit for that would be a relevant overhead, and having that more readily available seems like a significant improvement in debuggability. Greetings, Andres Freund