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 1la6Au-0007v9-Pf for pgsql-hackers@arkaria.postgresql.org; Sat, 24 Apr 2021 00:29:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1la6At-0004ez-Ff for pgsql-hackers@arkaria.postgresql.org; Sat, 24 Apr 2021 00:29:31 +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 1la6Ar-0004ZG-Sb for pgsql-hackers@lists.postgresql.org; Sat, 24 Apr 2021 00:29:31 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1la6Ap-00047J-5E for pgsql-hackers@postgresql.org; Sat, 24 Apr 2021 00:29:28 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 9A2F032FA; Fri, 23 Apr 2021 20:29:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 23 Apr 2021 20:29:24 -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:in-reply-to; s=fm1; bh=4kMzishCDif7yUoVtlQt2/ZcXqY FKxEyzr4R/pRiibs=; b=gjaRh14vM527DXs0Uw8PL7k7nQLZuvz1/c3JABAZPcF h5K9+i+WZF1s/REHIK191jWQyj60fvew8eaxPEJmD9nZF0R5gI7Wr+h9ej3JXhVT km6678Yyk8/HZKfTOqafp+sPgydDtRsrVq+4ZI46tj9hjGeyswcf/uHBqaxauuUL TTqufOGpO+IFVxbr8BhDOnQIkIvExWiT1Ntmu70FUg5F+0IECALTS7tdq7W/0LE4 NrokdhyXwEcyBUvC5GhNxT5Qw5wS/9MhIYVuqzwa4H9Hlw69q4bX1rrnsy9sKi+V SUB7u3cdRuw2mmOljbvIjOC7Ucjqptl8GBv/BXrP27A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm2; bh=4kMzis hCDif7yUoVtlQt2/ZcXqYFKxEyzr4R/pRiibs=; b=RH2htHTun/1YkpGtSqj0RG Udui3z8oIzzXhkePX22+aGOZ7xarAHQ5l/aM8wjOfzgJXy8iMS5T1pTy/he7kXSe bvzVzaMthBrFY6kbBoWq/s9vEhdKFF7oM+VqYy7BIqFD0EysTBJ6NXPKGeivxqs3 /uVARNucA7fKmxse2/HStDFaYsQ5N0JFME2u00nwrd0LnhKyqrxyfHCuOvZluO+9 U9WSVxH9XodBSuvKtChoUXxtwDW649uUKckNMdDqDWUu68CM709WDJ0C8nKzbYet zQcx+7P+5PJfFiTTEWq/5Sv3JqktIrO8M1j24U6+OuONh+F03DlA8vHRkYA6S04w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddufedgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedukefhkeelueegveetheelffffjeegleeuudelfeefuedtleffueejfffh ueffudenucfkphepuddtjedrudegvddrfeefrddutdefnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdr uggv X-ME-Proxy: Received: from intern.anarazel.de (107-142-33-103.lightspeed.sntcca.sbcglobal.net [107.142.33.103]) by mail.messagingengine.com (Postfix) with ESMTPA id 3F2791080063; Fri, 23 Apr 2021 20:29:23 -0400 (EDT) Date: Fri, 23 Apr 2021 17:29:21 -0700 From: Andres Freund To: Peter Geoghegan Cc: PostgreSQL Hackers Subject: Re: Testing autovacuum wraparound (including failsafe) Message-ID: <20210424002921.pb3t7h6frupdqnkp@alap3.anarazel.de> References: <20210423204306.5osfpkt2ggaedyvy@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 2021-04-23 16:12:33 -0700, Peter Geoghegan wrote: > The only reason that I chose 4GB for FAILSAFE_MIN_PAGES is because the > related VACUUM_FSM_EVERY_PAGES constant was 8GB -- the latter limits > how often we'll consider the failsafe in the single-pass/no-indexes > case. I don't really understand why it makes sense to tie FAILSAFE_MIN_PAGES and VACUUM_FSM_EVERY_PAGES together? They seem pretty independent to me? > I see no reason why it cannot be changed now. VACUUM_FSM_EVERY_PAGES > also frustrates FSM testing in the single-pass case in about the same > way, so maybe that should be considered as well? Note that the FSM > handling for the single pass case is actually a bit different to the > two pass/has-indexes case, since the single pass case calls > lazy_vacuum_heap_page() directly in its first and only pass over the > heap (that's the whole point of having it of course). I'm not opposed to lowering VACUUM_FSM_EVERY_PAGES (the costs don't seem all that high compared to vacuuming?), but I don't think there's as clear a need for testing around that as there is around wraparound. The failsafe mode affects the table scan itself by disabling cost limiting. As far as I can see the ways it triggers for the table scan (vs truncation or index processing) are: 1) Before vacuuming starts, for heap phases and indexes, if already necessary at that point 2) For a table with indexes, before/after each index vacuum, if now necessary 3) On a table without indexes, every 8GB, iff there are dead tuples, if now necessary Why would we want to trigger the failsafe mode during a scan of a table with dead tuples and no indexes, but not on a table without dead tuples or with indexes but fewer than m_w_m dead tuples? That makes little sense to me. It seems that for the no-index case the warning message is quite off? ereport(WARNING, (errmsg("abandoned index vacuuming of table \"%s.%s.%s\" as a failsafe after %d index scans", Doesn't exactly make one understand that vacuum cost limiting now is disabled? And is confusing because there would never be index vacuuming? And even in the cases indexes exist, it's odd to talk about abandoning index vacuuming that hasn't even started yet? > > For 2), I don't really have a better idea than making that configurable > > somehow? > > That could make sense as a developer/testing option, I suppose. I just > doubt that it makes sense as anything else. Yea, I only was thinking of making it configurable to be able to test it. If we change the limit to something considerably lower I wouldn't see a need for that anymore. Greetings, Andres Freund