Re: pgsql: Improve autovacuum logging for aggressive and anti-wraparound ru

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>, sawada.mshk@gmail.com, tgl@sss.pgh.pa.us, sk@zsrv.org, nasbyj@amazon.com, andres@anarazel.de, robertmhaas@gmail.com, pgsql-hackers@lists.postgresql.org
Date: 2019-03-29T14:22:55Z
Lists: pgsql-hackers
On 2019-Mar-29, Michael Paquier wrote:

> On Fri, Mar 29, 2019 at 09:11:47AM -0400, Andrew Dunstan wrote:
> > +                (errmsg_internal("found vacuum to prevent wraparound of
> > table \"%s.%s.%s\" to be not aggressive, so skipping",
> > 
> > This might convey something to hackers, but I doubt it will convey much
> > to regular users. Perhaps something like "skipping redundant
> > anti-wraparound vacuum of table ..." would be better.
> 
> "skipping redundant" is much better.

Yeah, that looks good to me too.  I wonder if we really need it as LOG
though; we don't say anything for actions unless they take more than the
min duration, so why say something for a no-op that takes almost no time?
Maybe make it DEBUG1.

> > The comment is also a bit too tentative. Perhaps something like this
> > would do:
> > 
> >     Normally the relfrozenxid for an anti-wraparound vacuum will be old
> >     enough to force an aggressive vacuum. However, a concurrent vacuum
> >     might have already done this work that the relfroxzenxid in relcache
> >     has been updated. If that happens this vacuum is redundant, so skip it.
> 
> That works for me.

s/relfroxzenxid/relfrozenxid/

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Commits

  1. Skip redundant anti-wraparound vacuums

  2. Improve autovacuum logging for aggressive and anti-wraparound runs

  3. In relevant log messages, indicate whether vacuums are aggressive.

  4. Don't vacuum all-frozen pages.