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 1la8Q6-0003hp-Ed for pgsql-hackers@arkaria.postgresql.org; Sat, 24 Apr 2021 02:53:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1la8Q5-0003aZ-5i for pgsql-hackers@arkaria.postgresql.org; Sat, 24 Apr 2021 02:53:21 +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 1la8Q4-0003aR-1a for pgsql-hackers@lists.postgresql.org; Sat, 24 Apr 2021 02:53:20 +0000 Received: from [64.147.123.24] (helo=wout1-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1la8Q1-0005Fn-ID for pgsql-hackers@postgresql.org; Sat, 24 Apr 2021 02:53:19 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 1B5472C78; Fri, 23 Apr 2021 22:53:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 23 Apr 2021 22:53:06 -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=A6ba0W5gS6uBrMqyW69Drj9dBs1 s0sHj2aVK77Yf6kI=; b=JKFh2XeS5Ltm4AYOS4BSKGdvTS7hOEewN3rjbHBcNWx dzAIm7D6N6GSitvXaISsUSkMb46PJgRlPM3NabHSi0d7JSg7C+2OdKy4mvH2IHud BoK+y171zjZ3Crf96LcV0KL1GpEA3qPJEfE6wnpVplrs9QlM4fSmsF1FYYNvcX0c PNiCqB9hW93FqwsYckg6HwYjA7qEWZJI6tJNrrIulIAQ/rTv+iDUmWwOojyttWRj aMjqWEH5okkcRQJMeyOXZZ36N6asGJNtXtKpuFJviYqUnMY4ECeUJ6G4tScOkxEc DstnJpJUbXj2bqhntwaQg06fJajXnTlkh1ipU69LwVQ== 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=A6ba0W 5gS6uBrMqyW69Drj9dBs1s0sHj2aVK77Yf6kI=; b=pymEb5ewp5dPMZQ+yHd57F jDaPc7mGlnTlIdf2NiRRtOPk6Uq/IILcTFKJFRyKwqLajSCJz0mUl4jeO2Bsep3V BiMTXG6KM5Za39vUmJSAwXFApFZHUXY15ncoRZjCdue1nJSTrGdz8kINBMsHvQSK 7vEgt6S0nCPCkKeNSU+GRGVcBZ/RRQI6DOZu2siw8zrMM/7+nhRGvSLU8bjY5lcr qpec/B3lXtJWqJwIVGefalDDL9g4MlLeMin/8LAoTzfz53jjwgxHs4nYiIcFpZRa i9TY4ka2fqFHxUuzmFXHJ6/xPNRDIItCMxYz2THuYHlI8QF/wNnIPRN8z5Qwu7EQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddufedgheelucetufdoteggodetrfdotf 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 64D211080063; Fri, 23 Apr 2021 22:53:04 -0400 (EDT) Date: Fri, 23 Apr 2021 19:53:03 -0700 From: Andres Freund To: Peter Geoghegan Cc: PostgreSQL Hackers Subject: Re: Testing autovacuum wraparound (including failsafe) Message-ID: <20210424025303.wtehilaqjwhk2gb3@alap3.anarazel.de> References: <20210423204306.5osfpkt2ggaedyvy@alap3.anarazel.de> <20210424002921.pb3t7h6frupdqnkp@alap3.anarazel.de> <20210424023314.iem2gxm7cuaj66au@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.24 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-04-23 19:42:30 -0700, Peter Geoghegan wrote: > On Fri, Apr 23, 2021 at 7:33 PM Andres Freund wrote: > > Check it every so often, independent of whether there are indexes or > > dead tuples? Or just check it at the boundaries. > > I think that the former suggestion might be better -- I actually > thought about doing it that way myself. Cool. > The latter suggestion sounds like you're suggesting that we just check > it at the beginning and the end in all cases (we do the beginning in > all cases already, but now we'd also do the end outside of the loop in > all cases). Is that right? Yes. > If that is what you meant, then you should note that there'd hardly be > any check in the one-pass case with that scheme (apart from the > initial check that we do already). The only work we'd be skipping at > the end (in the event of that check triggering the failsafe) would be > heap truncation, which (as you've pointed out yourself) doesn't seem > particularly likely to matter. I mainly suggested it because to me the current seems hard to understand. I do think it'd be better to check more often. But checking depending on the amount of dead tuples at the right time doesn't strike me as a good idea - a lot of anti-wraparound vacuums will mainly be freezing tuples, rather than removing a lot of dead rows. Which makes it hard to understand when the failsafe kicks in. Greetings, Andres Freund