From: Michael Paquier <michael@paquier.xyz>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Sergei Kornilov <sk@zsrv.org>
Cc: nasbyj@amazon.com, Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: pgsql: Improve autovacuum logging for aggressive and anti-wraparound ru
Date: Fri, 5 Oct 2018 12:16:03 +0900
Message-ID: <20181005031603.GF1629@paquier.xyz> (raw)
In-Reply-To: <CAD21AoBR+y31ps+=G6_fxxVd_o1itTnaK19sDAEhAP_RyVT2AA@mail.gmail.com>
References: <23209391537822541@iva4-6d7004ac8463.qloud-c.yandex.net>
<20180924211117.tpwxemzd3372nagj@alvherre.pgsql>
<CAD21AoAV17jQH6__E8_VQePms4NptX0X50U=98qJ5RNV7au1iw@mail.gmail.com>
<20181002001151.GP11712@paquier.xyz>
<CAD21AoB-nhVxo=6__BeukNniHnt6UGMKRs3v=Zkn-WJq9kx+4A@mail.gmail.com>
<20181002065508.GC17642@paquier.xyz>
<338.1538489728@sss.pgh.pa.us>
<CAD21AoBR+y31ps+=G6_fxxVd_o1itTnaK19sDAEhAP_RyVT2AA@mail.gmail.com>
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
Attachments:
[text/x-diff] fix_autovacuum_log_v3.patch (1.2K, ../20181005031603.GF1629@paquier.xyz/2-fix_autovacuum_log_v3.patch)
download | inline diff:diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.cindex 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, VacuumParams *params,
if (options & VACOPT_DISABLE_PAGE_SKIPPING)
aggressive = true;
+ /* vacuum preventing wraparound must be aggressive */+ Assert((params->is_wraparound && aggressive) ||+ !params->is_wraparound);+
vacrelstats = (LVRelStats *) palloc0(sizeof(LVRelStats));
vacrelstats->old_rel_pages = onerel->rd_rel->relpages;
@@ -376,10 +380,8 @@ lazy_vacuum_rel(Relation onerel, int options, VacuumParams *params,
initStringInfo(&buf);
if (params->is_wraparound)
{
- if (aggressive)- msgfmt = _("automatic aggressive vacuum to prevent wraparound of table \"%s.%s.%s\": index scans: %d\n");- else- msgfmt = _("automatic vacuum to prevent wraparound of table \"%s.%s.%s\": index scans: %d\n");+ /* autovacuum preventing wraparound has to be aggressive */+ msgfmt = _("automatic aggressive vacuum to prevent wraparound of table \"%s.%s.%s\": index scans: %d\n");
}
else
{
[application/pgp-signature] signature.asc (832B, ../20181005031603.GF1629@paquier.xyz/3-signature.asc)
download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, sawada.mshk@gmail.com, tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, sk@zsrv.org, andres@anarazel.de, robertmhaas@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: Improve autovacuum logging for aggressive and anti-wraparound ru
In-Reply-To: <20181005031603.GF1629@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox