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 1g8Jhk-0003D2-Mn for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Oct 2018 06:35:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g8Jhj-0002oT-5n for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Oct 2018 06:35:15 +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 1g8Jhi-0002oL-Sb for pgsql-hackers@lists.postgresql.org; Fri, 05 Oct 2018 06:35:14 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g8Jhg-0004EB-R0 for pgsql-hackers@lists.postgresql.org; Fri, 05 Oct 2018 06:35:14 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2EA7621BF1; Fri, 5 Oct 2018 02:35:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 05 Oct 2018 02:35:11 -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=fm2; bh=9WcGJ348FLGeMc1ZaqaGoVmZWf3 FkvB7cTlxUUxc0w0=; b=C3lFAPWoxxix3taei+lWAC2cgfK53zJPk83wVF9vMxe 7sAL7oOj1DDhgDmAT1q/flT0Dij67tB4ZLRNYwaRDVsiM9VCASHCzHKBD68FY9/F SbxqKOJc5qZW0ZduiZY4QYo4s4Mr8Hej6s3Ov7RVvO6+TyLFUTF7/Vcd9wdxhk74 rNeuZHev4zr6Xt/FpkvdFnogFmjgBv0hs6sXeXkYuLtEr07n8UTlbfp6CxzmK8d+ RntjgSaKJrmT/6SLQ6KSgfjy2X6hnLitRnVLCAzZAZxrdnU49n5+8p3fibNbwCpd lRlGuIE91GfLfHa6Nba4ebiiikJKWykVJKOTwX0ICIA== 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=fm3; bh=9WcGJ3 48FLGeMc1ZaqaGoVmZWf3FkvB7cTlxUUxc0w0=; b=f298ue0TGGnP7k6TmWZQpL GkjImWkWIOQYWJxy872dafbUvJj0IWFKPWh9dQ80dlTkhg4IIlQ7FNa2fcGfOhco QZak5rJmRTCtoUJA3AosLtlz3KhPrWIK37xqCZxb4RXJZrOUeiVOvWwboc1WPhWU laSLh20fl8VByDkPeDw3GcvIJyXLfGkmEbMN7pgDCHQDEza0atQh6rAtxpd7VAsj gVBXWCu7dP7sUCU4WDkAXldsIJoMlunwLG/IGc7ibLmbsxtryAmYbHiVMswFwmD9 9FY9sQoiahthZ/8WFZkN2MTB9xrHUtindg/iIGgvCWDZ0SjrtPS8V0Ky4CRS8Leg == X-ME-Sender: X-ME-Proxy: Received: from paquier.xyz (mp76f1f85b.ap.nuro.jp [118.241.248.91]) by mail.messagingengine.com (Postfix) with ESMTPA id 931DDE446A; Fri, 5 Oct 2018 02:35:07 -0400 (EDT) Date: Fri, 5 Oct 2018 15:35:04 +0900 From: Michael Paquier To: Masahiko Sawada Cc: Tom Lane , Alvaro Herrera , Sergei Kornilov , nasbyj@amazon.com, Andres Freund , Robert Haas , PostgreSQL Hackers Subject: Re: pgsql: Improve autovacuum logging for aggressive and anti-wraparound ru Message-ID: <20181005063504.GB14664@paquier.xyz> References: <23209391537822541@iva4-6d7004ac8463.qloud-c.yandex.net> <20180924211117.tpwxemzd3372nagj@alvherre.pgsql> <20181002001151.GP11712@paquier.xyz> <20181002065508.GC17642@paquier.xyz> <338.1538489728@sss.pgh.pa.us> <20181005031603.GF1629@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Md/poaVZ8hnGTzuv" Content-Disposition: inline In-Reply-To: <20181005031603.GF1629@paquier.xyz> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Md/poaVZ8hnGTzuv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Oct 05, 2018 at 12:16:03PM +0900, Michael Paquier wrote: > So, I have come back to this stuff, and finished with the attached > instead, so as the assertion is in a single place. I find that > clearer. The comments have also been improved. Thoughts? And so... I have been looking at committing this thing, and while testing in-depth I have been able to trigger a case where an autovacuum has been able to be not aggressive but anti-wraparound, which is exactly what should not be possible, no? I have simply created an instance with autovacuum_freeze_max_age = 200000, then ran pgbench with autovacuum_freeze_table_age=200000 set for each table, and also ran installcheck-world in parallel. This has been able to trigger the assertion pretty quickly. Here is the stack trace: #2 0x000055e1a12ef87b in ExceptionalCondition (conditionName=0x55e1a14b45c8 "!((params->is_wraparound && aggressive) || !params->is_wraparound)", errorType=0x55e1a14b459d "FailedAssertion", fileName=0x55e1a14b4590 "vacuumlazy.c", lineNumber=254) at assert.c:54 #3 0x000055e1a0f6c6ad in lazy_vacuum_rel (onerel=0x7f163e7ea710, options=65, params=0x55e1a2eeba70, bstrategy=0x55e1a2f5c1a0) at vacuumlazy.c:253 #4 0x000055e1a0f6c217 in vacuum_rel (relid=1260, relation=0x55e1a2f5d748, options=65, params=0x55e1a2eeba70) at vacuum.c:1714 #5 0x000055e1a0f6a3ac in vacuum (options=65, relations=0x55e1a2f2f050, params=0x55e1a2eeba70, bstrategy=0x55e1a2f5c1a0, isTopLevel=true) at vacuum.c:340 #6 0x000055e1a10c1ddd in autovacuum_do_vac_analyze (tab=0x55e1a2eeba68, bstrategy=0x55e1a2f5c1a0) at autovacuum.c:3121 #7 0x000055e1a10c0e19 in do_autovacuum () at autovacuum.c:2476 $2 = {spcNode = 1664, dbNode = 0, relNode = 1260} (gdb) p onerel->rd_node.relNode $3 = 1260 (gdb) p params->is_wraparound $4 = true (gdb) p aggressive $5 = false I still have the core file, the binaries and the data folder, so it's not a problem to dig into it. -- Michael --Md/poaVZ8hnGTzuv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlu3BhgACgkQnvQgOdby QH1wgA//enPc2MUAzxOcfH4Tp4eeVb08B0CXsAxdA8j2f8LK77i8OsAfsr9+s9O4 Ug9zEpr0E5ApbcMH2oorCcI7Kpt/sCqAp2L6Ht9URVz1+Ds03vlbulLexzZuyPoc Eo0tUnRdWVJp6xFeg2oRh1iaoQxh1qW+/V+wQ03oyCdrG8L0qvsBDqYk4MMMg8qZ H7pOW7RaimhpaG1FcfxlF5/ia2q3w8ydnKTvNPX0mi/NS2if5t1MVthXlC5T4gIB Z6TjLa2ClNUE2HpTqI9izI2nMNDERzBBWIAPcwOvLeBO2x1YyqEssKEIEQ8lwXWS 2EyiE21wINUquf4OxZNYSxBoqQFOHjhBACng4gXevbh/h984nYo6fW6qg9OmGm7N wlKEZvGA469zhH8JX1rW2o4H1FIJLWUWBubp3KGo99HJwSSy3/8iY6oYkR+A1Ymc xI5Sk5c1UClVs3tBFvA/cHcLw8mXuznn5IbtVaivuucAxxG/ldANLWSXJUhJKkMG GJHF4Fon26o2PMP9x17DobfPI4EJZJL5hdfPx3nsRYxrxf16riIORxZqXr0FgI0c 4wvcMIyZ3o+QEV3fbZ7Ue6pXwbxPBmo8HIzN/dAbxoSfbP/LEVFi64R3gpac3cWg UIK09KIzt4RyYsj7ifNT9u/Ngsd2gNloR1D1a+YZD76j0+XQN+Y= =Qbcq -----END PGP SIGNATURE----- --Md/poaVZ8hnGTzuv--