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 1nLbQl-00006m-6c for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Feb 2022 01:54:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nLbQj-0004af-0K for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Feb 2022 01:54:29 +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 1nLbQg-0004aV-Pk for pgsql-hackers@lists.postgresql.org; Sun, 20 Feb 2022 01:54:28 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nLbQc-0004Rf-7b for pgsql-hackers@lists.postgresql.org; Sun, 20 Feb 2022 01:54:25 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 2048D3200A5F; Sat, 19 Feb 2022 20:54:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 19 Feb 2022 20:54:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; bh=pbi7E8Z2zjWONW6oxvp+YpU9zsRJV6tjlEVwT2 +DL40=; b=k/OWhwQ/zB4Y1SH5/+nPxjjA0zBSIRHaDWrVOukMcc+6r0W1nXm2v/ dJzzYmaleXJsWEK4iPnwD/TDE0dPJbCBppdwP0ycJ8vaXrwKUKem1CkX8zRYDXvH Gu/FE1xr5tnuvL0BOEKBwzkIu3QinzShfRoks/e7XA+RI47XFnlsiNg307c2UQQI QeeOVTXi/c1MQTKg68QSJ85P0jwrhbCHKI3NYJ9F7t/a7fQYBYMUkD6YNsy8Rtjn DRM5yyl1GVsBOr+wdMAiEqsb/rgj/oAw4Xi0uun+FnaA2MqhDN0Iya6itGUI9QVj ZcPjGNcTm3/tCmB6FnNaYFylWbd5lSUw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=pbi7E8Z2zjWONW6ox vp+YpU9zsRJV6tjlEVwT2+DL40=; b=JbO2OA1bldDVhhY009jRtvJexU1gRn0qF rdh0cu5kZ4KgEfiusxjwxP80UnPKYhajS2C+0p/asMXZPWMtJ304mWsJwwrCiK9k SVdgbU/ON0W8Qwh3hvDWO7k1bTjrR7FMDiEWc0MNU+ny1b4zpa6miLUP0IZEvD0I d9QwLhyAILno/S54VDpNN/w3ZQdHv7Bdq10rTWlrT1bdmLdALAOrTzwMXc/W6Ogi PcDOljNuEV3LwifQh93HiovWJ6ZHyj8Gcoq5560B0lcnDFlCfYcDuzeQoY4MxWDu tInfpmoPNOrN9nvcnZWesY4sB9S9xFqxxErJTWdplfhsOVilRxB/w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkeefgdeflecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepudekhfekleeugeevteehleffffejgeelueduleeffeeutdelffeujeffhfeu ffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 19 Feb 2022 20:54:18 -0500 (EST) Date: Sat, 19 Feb 2022 17:54:16 -0800 From: Andres Freund To: Peter Geoghegan Cc: Robert Haas , Masahiko Sawada , PostgreSQL Hackers Subject: Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations Message-ID: <20220220015416.gxnocs4we56ghmj3@alap3.anarazel.de> References: <20220218221117.ijozsjwaxa6fy5u6@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2022-02-19 17:22:33 -0800, Peter Geoghegan wrote: > Looks like pg_surgery isn't processing HOT chains as whole units, > which it really should (at least in the context of killing items via > the heap_force_kill() function). Killing a root item in a HOT chain is > just hazardous -- disconnected/orphaned heap-only tuples are liable to > cause chaos, and should be avoided everywhere (including during > pruning, and within pg_surgery). How does that cause the endless loop? It doesn't do so on HEAD + 0001-Add-adversarial-ConditionalLockBuff[...] for me. So something needs have changed with your patch? > It's likely that the hardening I already planned on adding to pruning > [1] (as follow-up work to recent bugfix commit 18b87b201f) will > prevent lazy_scan_prune from getting stuck like this, whatever the > cause happens to be. Yea, we should pick that up again. Not just for robustness or performance. Also because it's just a lot easier to understand. > Leaving behind disconnected/orphaned heap-only tuples is pretty much > pointless anyway, since they'll never be accessible by index scans. > Even after a REINDEX, since there is no root item from the heap page > to go in the index. (A dump and restore might work better, though.) Given that heap_surgery's raison d'etre is correcting corruption etc, I think it makes sense for it to do as minimal work as possible. Iterating through a HOT chain would be a problem if you e.g. tried to repair a page with HOT corruption. Greetings, Andres Freund