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 1g8GbO-0000CS-HI for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Oct 2018 03:16:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g8GbK-0002eW-O4 for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Oct 2018 03:16:26 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g8GbI-0002eO-Nw for pgsql-hackers@lists.postgresql.org; Fri, 05 Oct 2018 03:16:26 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g8Gb5-0000WV-Lw for pgsql-hackers@lists.postgresql.org; Fri, 05 Oct 2018 03:16:23 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4C60621BD5; Thu, 4 Oct 2018 23:16:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 04 Oct 2018 23:16:10 -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=Y1CJIk8ATSPjfGqIG5U2Lv2kaRK dvjuq/wOX1JvAiq0=; b=KlQFQqZ+D6UOMYSQB/45DiEViigoj/TH8+Zav2dVzhd JZlN7l6asemdOnbLNZq4tTnNqt2eyJYBIr9IMOLaFYUZ130PbeoUd4UFhGik/qFB eEs9sYgeRY+kSKas4JWHx5ZZKN1u5M0HJL13/P9OcxgPtFTvphU1MoqiRMefVxbo 2Ru68XrhlRp0IbTB/R3lBS5tM5HdJ0JpdUeJWEAqTjo3uRhz9xWmKEl7lydta3BK aZ63lyPyKxZf+1+vwcAZI9ykAZV/MmBXv4r8HUtA0+7jzzBSTeP0bnKTXv0ufeiw nc2If62vBdhkBuG7Tvf6Q+MI2UZ60C8KlHIz3trofHg== 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=Y1CJIk 8ATSPjfGqIG5U2Lv2kaRKdvjuq/wOX1JvAiq0=; b=XfXnFXo1OAVlA6lXvnsqoD KioHx5DpAxpQg5ZDpYml9AxLhHNjglatFScfyIBASqFIvQ+IqfibiaHiJE7CTzFk UHLw0F7SdWQUyOT0zOxs1T8kXuWF1ZjES/+6juYpYuHP7tKCPW4+bmiMRZMTPQh1 DwN+gaK7LYqCgTrfQmMxIubZHIrG/Chy9HAvzEqz8UVEmWSRASwq07dL+c4yd1LS VNmgWXJsVJugEojUr7RwSqVkCHQ2GeosoOcw+7x+A4e7MK1z6xTqs68Y9m52WHfM TCsfo2pSdmQVJoXrkyYSkrZ7Orxb8zvhLnFEruMaijlKpVxhOqoBJfgoNLjSRniA == X-ME-Sender: X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id B2C5EE479F; Thu, 4 Oct 2018 23:16:06 -0400 (EDT) Date: Fri, 5 Oct 2018 12:16:03 +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: <20181005031603.GF1629@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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VkqCAaSJIySsbD6j" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --VkqCAaSJIySsbD6j Content-Type: multipart/mixed; boundary="zGQnqpIoxlsbsOfg" Content-Disposition: inline --zGQnqpIoxlsbsOfg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Oct 03, 2018 at 04:37:29PM +0900, Masahiko Sawada wrote: > Thank you for the comment. Attached the updated patch. 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? -- Michael --zGQnqpIoxlsbsOfg Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="fix_autovacuum_log_v3.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuu= mlazy.c index 8996d366e9..e73b548ac3 100644 --- a/src/backend/commands/vacuumlazy.c +++ b/src/backend/commands/vacuumlazy.c @@ -249,6 +249,10 @@ lazy_vacuum_rel(Relation onerel, int options, VacuumPa= rams *params, if (options & VACOPT_DISABLE_PAGE_SKIPPING) aggressive =3D true; =20 + /* vacuum preventing wraparound must be aggressive */ + Assert((params->is_wraparound && aggressive) || + !params->is_wraparound); + vacrelstats =3D (LVRelStats *) palloc0(sizeof(LVRelStats)); =20 vacrelstats->old_rel_pages =3D onerel->rd_rel->relpages; @@ -376,10 +380,8 @@ lazy_vacuum_rel(Relation onerel, int options, VacuumPa= rams *params, initStringInfo(&buf); if (params->is_wraparound) { - if (aggressive) - msgfmt =3D _("automatic aggressive vacuum to prevent wraparound of ta= ble \"%s.%s.%s\": index scans: %d\n"); - else - msgfmt =3D _("automatic vacuum to prevent wraparound of table \"%s.%s= =2E%s\": index scans: %d\n"); + /* autovacuum preventing wraparound has to be aggressive */ + msgfmt =3D _("automatic aggressive vacuum to prevent wraparound of tab= le \"%s.%s.%s\": index scans: %d\n"); } else { --zGQnqpIoxlsbsOfg-- --VkqCAaSJIySsbD6j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlu213MACgkQnvQgOdby QH0+cQ//R7shS1cYc/y8Sh0Ndh5k4I3Fpa8aba/BXucqk/udXEpSHwcivPa3MTB0 QEa/mERF0TWjGNnVQfURyEm5KpRovPzHrMfwYKNMtB6O6Sm1aDRqMX5Dkr64n7jG nDwv42ZmG5iPIabJ1kl13OkmcYUdXKrrI04i/WbeMHNNNuW8uxRMHyirYCUntqf6 UHz7DFelSoJsE5rXHGy8joHZesjRw//YCyLATrgCg/6uiBjGyJ9p+1XNVQF1heRt WXGxFcuHJkQjMGwewr4sGRDlSXZI7PEqxHDFNFmh8ICDL1oHGquJzfvbkl2ykqGt zyE3aLs6QdGk3JQrtbQpzDImJrSI5jatPgFaR/LNlDreFoJTr3/0OF1qfdjDK7hZ n+trMBAR4W02Fq1bBBmwjk4ayk41iOilWg5l+4YK4bejKb9+vJQMMHeEVwktac2l R6nTLz4qluhQeEnnRZCq4ggq+QfgZWguR8L0R+DJrXT+EyyDsTRwTg/3AFi3Pcrg WVHxOmsKNNTh1ft01EeuDAvOsceExsMCmzK2SLHys1ZvfrFgsFkxFkW29akY+XhZ BSA3RRjgYuaasaIFxOaFOFLqQ1JQSdHPbOraQDHHbPEKx5eqK/LG/z92TpyvQAJs h0UWzSgIE2mrPFxsId2KSRidqiR/c6Z2+k+YrpRJGLQH4aU+/ZY= =AlDz -----END PGP SIGNATURE----- --VkqCAaSJIySsbD6j--