Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jGbNW-0002fQ-5o for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2020 04:41:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jGbNU-0000kG-Br for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2020 04:41:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jGbNS-0000k8-OR for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2020 04:41:24 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jGbNL-0008Q2-8o for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2020 04:41:21 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id F0FF35C00F5; Tue, 24 Mar 2020 00:41:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 24 Mar 2020 00:41:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=mdFWkNkUdHC7iMaTMN79c+AMAbz R9Sxcm40o2W+Ucss=; b=clwpmarpPO6cRD4v5obnibJ+7py6A9cORgvbumxodhB 7GqdeazF6zsydLPfOOd+lsFGMAnL+OQG5rOk9F42M9TkPsP//l2GERovttflqnFO OyNs8SFIgXhxLkFWrZMoXx+x4hDLo57hdDFXklUp30rVNYr+snXmO96A3n94GNbk K5fx5JporU+6yj07Ksobm70t+6Lz2P6c+ycd15hvN/HEwqhGThdx2x5D+Gavf2hL bxfW+DcEhPg3l+qcGqogpAKSOUhHL7kPdQ+X8K3WhUIU0NXn4X0loUoHaTHh5hc/ SdjbiqF7nA2+oQup0GjZLjUWEqCuBsg+Cf1VNj379CA== 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=mdFWkN kUdHC7iMaTMN79c+AMAbzR9Sxcm40o2W+Ucss=; b=JFBEMUvPSrBLohRLWsS3Wu p4gMQs9kVp26KKhftxCTYOJgNJiMumYTtteYvT5Rc7i7bxueEpSngUzt8XQMzDjf Ljivf3KHfcWfVgFlgS0sKP6okaW2DU1z89HSDL4o/GWfCv3YHO0hUIWxtJ60msLz Pb6thtbWge68I6wgSzt+mx0jCbY0axVS/MG6SXMt7N8ipzylOwuNHaNmvWJNg0EN XCn/KpcqwBS6eFLnPeNbpoxXALDPyrxOOf5CoIXn4OMYmH5G+yLXUCT5luSotK2w nsNTTWWCMKecWcyLtKUaNdV2SJZuM0ev0DlfbWicc9FbiILTLlzf4/nh/pMnimxg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudegledgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecu kfhppeduuddurddutddvrddukedtrddukeehnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 485A43280064; Tue, 24 Mar 2020 00:40:25 -0400 (EDT) Date: Tue, 24 Mar 2020 13:40:16 +0900 From: Michael Paquier To: Andres Freund Cc: Andrew Dunstan , Kyotaro HORIGUCHI , sawada.mshk@gmail.com, tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, sk@zsrv.org, nasbyj@amazon.com, robertmhaas@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Improve autovacuum logging for aggressive and anti-wraparound ru Message-ID: <20200324044016.GD1836@paquier.xyz> References: <20181005031603.GF1629@paquier.xyz> <20181005063504.GB14664@paquier.xyz> <20181009.181536.142257785.horiguchi.kyotaro@lab.ntt.co.jp> <920b7f84-407c-005c-4b7d-e8266a17d22b@2ndQuadrant.com> <20190309011537.GD9266@paquier.xyz> <20190329115138.GD1954@paquier.xyz> <20200324014150.2nyuygbbejzaybip@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="84ND8YJRMFlzkrP4" Content-Disposition: inline In-Reply-To: <20200324014150.2nyuygbbejzaybip@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --84ND8YJRMFlzkrP4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Mar 23, 2020 at 06:41:50PM -0700, Andres Freund wrote: > Which valid scenario can lead to this? Neither the comment, nor commit > message explain it. The commit message mentions that concurrent autovacuum jobs can lead to the creation of non-aggressive and anti-wraparound jobs, which have no sense because an aggressive and anti-wraparound job was already done in parallel with a different worker, and that this was possible because of inconsistent relcache lookups across concurrent jobs. This was mentioned upthread. > Unless you're thinking of scenarios where autovacuum > and manual vacuum are mixed, I don't really see valid reasons? Normally > autovacuum's locking + the table_recheck_autovac() check should prevent > problematic scenarios. > > I do see a few scenarios that can trigger this - but they all more or > less are bugs. Hmm. OK. > It doesn't strike me as a good idea to work around such bugs by silently > neutering heap_vacuum_rel(). The likelihood of that temporarily covering > up more severe problems seems significant - they're likely to then later > bite you with a cluster shutdown. Saying that, I have been thinking about this one for a couple of days now and it seems to me that this is a factor contributing to what we are seeing in [1], and I agree that this is just an incorrect approach that makes easier to trigger the real underlying issues, while table_recheck_autovac() ought to be the only code path doing the skip job. Note that I have failed to reproduce the behavior of the other thread though, always finishing with a non-aggressive anti-wraparound skipped because of an aggressive and anti-wraparound job happened just before in parallel, and autovacuum was always able to continue triggering new jobs, keeping the relfrozenxid age at bay. So I would like to first revert that part, to have a cleaner state to work on the underlying issues. A pure revert means also adding back the log message for non-aggressive and anti-wraparound jobs that should never exist, which should be replaced by an assertion once all the holes are fixed. What do you think? [1]: https://www.postgresql.org/message-id/CAE39h23RTX1jkYjWc5tccv34HwwraizaCUxOmdQdPM+Zt5-2Qg@mail.gmail.com -- Michael --84ND8YJRMFlzkrP4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl55jzAACgkQnvQgOdby QH2YtQ/9ESsLGgjFV4QH6vJYTkQL896sTAqap+tL6yFFVNfx1yTZKzuR1Fa/AuQm sZEkFDcLhvH5sak8lBxLzeDXabESc/vhTwUZ8heoAbHvrRffana+MWqDgm85edVR P/5MnvtYSgZbMhH1cFk8IirbkcdGSmSfhyamYc45YLEHwFoko0fTCGj2weEa5/Df C54HzA4/tukzMpnNb8IfW/6lgkU6b57YtSSMY2T75ATOza+MJ1zoG7Q/NKQnZEgS sieN8ofY5hemNraEpTdiO5+Gmh46Ccw5+Q0X/cXIu4VZ1X/tCK5Wty9xMc00Wun3 kJ9JIabgv+mhTyWQTOHn8rBm60Of/oVefyeXeGAL3uKV1hQJaHlzPOt+LxhOWtXk 1d1plqgg2+rl9UlWB+t9VCCet64FkgfDJ7j3miMPDzZ3Hq6Km2BmYginB8X+tKuE OMkxNkZgKqeSCM+USx8+VTwiN87LT/O64mc3xCGaHpBK3sdRxNrLweFqRb9HAMuB Q+S+clSbf/0p67pFEqyFu1pGSYb9fnOjAKK2L0dY9O/CBokjw010uU/i1D5KRl6o 5Lo0OrPy/An5TEcSCQftDH7LfNfSuwq/0M7T6k89qwljYg15DWeeuFramcMn5tRp wqUEoTTzaktf9pff9rdSsNnIbkqfsgt+C0NlDTNvHzbG73HUY2U= =vO24 -----END PGP SIGNATURE----- --84ND8YJRMFlzkrP4--