Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4Vc7-000715-Ln for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Sep 2018 18:29:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g4Vc5-0004Su-UW for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Sep 2018 18:29:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4Vc5-0004Sn-NU for pgsql-hackers@lists.postgresql.org; Mon, 24 Sep 2018 18:29:41 +0000 Received: from wnew1-smtp.messagingengine.com ([64.147.123.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4Vc3-0001dl-N5 for pgsql-hackers@lists.postgresql.org; Mon, 24 Sep 2018 18:29:41 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id DF245323; Mon, 24 Sep 2018 14:29:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 24 Sep 2018 14:29:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=ejm2ngWEWe4GXiDWi1MGE9aTIDf4T jJe2DZAw7yAF/4=; b=sINl5P9K4Gy+rD5PET4R4P5trfa0gnB6luYAfAIQTeN7D 84rLbtiOz706r+tgktPdT2XCo5lSumrLjQvdkW/MKCM0EX8Tjt7lmrUJlJ3CHOV+ dCgUuyEaranH+uNTn9gAwIkEiI0fvAWB7tAxDMBgFUz8cL3xNsYSvueSAztwO0d2 4OxWObPWIUprutFnUQ5o2EKm5cL037Ti3WzNG+sQudVh0z+xmdFx87iZ6VrHNlA0 MtBLwroZdnLe0IilxNXfsJuo7Yv4JV0j3Ytfh3fXMVTFDSKhnhotLQ114fGMljBs LyvDxIPwJvl+mUfCbwzJ+w2z+RnUIi11gmzJDqQvg== 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-sender:x-me-sender:x-sasl-enc; s=fm3; bh=ejm2ng WEWe4GXiDWi1MGE9aTIDf4TjJe2DZAw7yAF/4=; b=YPtOa5nHt/h/7kk/L+M9YA yYkD53V3ZauDzYRp8BdPaAMIYDp4r/4U4BXiiMbTUNA9DCg88X3eZNdQizSFCFlS phHXKZIbUhqhMM5PYvG396cJj9xVJ6hCG7hEqQ1rkSshR0YJKT0/C2xjjDbzudNj XiF3aSLgUWaIInM2BXBmko9SMjQpiu8MdrRaJxehUGdRQL7XT1oXsC2k+Qszlc8q DvbCx9um5K9qWpKlzNspggkJr+yJ2b4MeGyCoiOkbBAVdaVOU5is+tLdjzXFnX4d kLO4r2mlQRdDvG5ygzaOh1Lj1im82HIrSmo04waVV/N2bwh9OJtQ1dnFOEnany7g == X-ME-Proxy: X-ME-Sender: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 83EA8E467D; Mon, 24 Sep 2018 14:29:35 -0400 (EDT) Date: Mon, 24 Sep 2018 11:29:34 -0700 From: Andres Freund To: "Nasby, Jim" Cc: Sergei Kornilov , Robert Haas , Alvaro Herrera , Michael Paquier , PostgreSQL Hackers Subject: Re: pgsql: Improve autovacuum logging for aggressive and anti-wraparound ru Message-ID: <20180924182934.rpl3lkoisy5o2tx4@alap3.anarazel.de> References: <20180914153554.562muwr3uwujno75@alvherre.pgsql> <7924791537551496@myt5-c56023d17c6b.qloud-c.yandex.net> <20180921174347.wvszsn7uk56zvz7o@alap3.anarazel.de> <0A11E30F-DDDE-422F-B22A-3F6E3AA7A0A2@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0A11E30F-DDDE-422F-B22A-3F6E3AA7A0A2@amazon.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-09-24 18:25:46 +0000, Nasby, Jim wrote: > > > On Sep 21, 2018, at 12:43 PM, Andres Freund wrote: > > > >> But as far i can see it is possible have aggressive non-wraparound vacuum. One important difference - regular and aggressive regular can be canceled by backend,.wraparound autovacuum can not. (by checking PROC_VACUUM_FOR_WRAPAROUND in src/backend/storage/lmgr/proc.c ) > > > > Yes, without checking the code, they should be different. Aggressive is > > controlled by vacuum_freeze_table_age whereas anti-wrap is controlled by > > autovacuum_freeze_max_age (but also implies aggressive). > > Right, except that by the time you get into the vacuum code itself nothing should really care about that difference. AFAICT, the only thing is_wraparound is being used for is to set MyPgXact->vacuumFlags |= PROC_VACUUM_FOR_WRAPAROUND, which prevents the deadlock detector from killing an autovac process that’s trying to prevent a wraparound. I think it’d be clearer to remove is_wraparound and move the check from vacuum_rel() into lazy_vacuum_rel() (which is where the limits for HeapTupleSatisfiesVacuum get determined). Something like the attached. I'm very doubtful this is an improvement. Especially with the upcoming pluggable storage work making vacuumlazy.c heap specific, while vacuum.c stays generic. The concept of something like PROC_VACUUM_FOR_WRAPAROUND, should imo not be pushed down that much (even if criteria for it might). Greetings, Andres Freund