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

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Sergei Kornilov <sk@zsrv.org>
Cc: Robert Haas <robertmhaas@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Michael Paquier <michael@paquier.xyz>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2018-09-21T17:43:47Z
Lists: pgsql-hackers
Hi,

On 2018-09-21 20:38:16 +0300, Sergei Kornilov wrote:
> > My first question was whether TWO of them were dead code ... isn't an
> > aggressive vacuum to prevent wraparound, and a vacuum to prevent
> > wraparound aggressive?
> Maybe i am wrong, aggressive autovacuum was your commit.
> Message split was in b55509332f50f998b6e8b3830a51c5b9d8f666aa
> Aggressive autovacuum was in fd31cd265138019dcccc9b5fe53043670898bc9f
> 
> If aggressive really is wraparound without difference - i think we need refactor this code, it is difficult have two different flags for same purpose.
> 
> But as far i can see it is possible have aggressive non-wraparound vacuum. One important difference - regular and aggressive regular can be canceled by backend,.wraparound autovacuum can not. (by checking PROC_VACUUM_FOR_WRAPAROUND in src/backend/storage/lmgr/proc.c )

Yes, without checking the code, they should be different. Aggressive is
controlled by vacuum_freeze_table_age whereas anti-wrap is controlled by
autovacuum_freeze_max_age (but also implies aggressive).

Greetings,

Andres Freund


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.