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

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Sergei Kornilov <sk(at)zsrv(dot)org>, nasbyj(at)amazon(dot)com, Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Improve autovacuum logging for aggressive and anti-wraparound ru
Date: 2018-09-28 04:53:14
Message-ID: CAD21AoAV17jQH6__E8_VQePms4NptX0X50U=98qJ5RNV7au1iw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, Sep 25, 2018 at 6:11 AM Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
>
> On 2018-Sep-24, Sergei Kornilov wrote:
>
> > Hi
> >
> > > An autovacuum can't be just aggressive; it's either anti-wraparound or normal.
> > But autovacuum _can_ be aggressive and not anti-wraparound.
> > I build current master and can see 3 different line types:
> > 2018-09-24 23:47:31.500 MSK 27939 @ from [vxid:4/272032 txid:0] [] LOG: automatic aggressive vacuum of table "postgres.public.foo": index scans: 0
> > 2018-09-24 23:49:27.892 MSK 28333 @ from [vxid:4/284297 txid:0] [] LOG: automatic aggressive vacuum to prevent wraparound of table "postgres.public.foo": index scans: 0
> > 2018-09-24 23:49:29.093 MSK 28337 @ from [vxid:4/284412 txid:0] [] LOG: automatic vacuum of table "postgres.public.foo": index scans: 0
>
> Exactly.
>
> It cannot be anti-wraparound and not aggressive, which is the line type
> not shown.
>
> "Aggressive" means it scans all pages; "anti-wraparound" means it does
> not let itself be cancelled because of another process waiting for a
> lock on the table.
>

I agree. Can we fix this simply by the attached patch?

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
fix_autovacuum_log.patch application/octet-stream 820 bytes

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2018-09-28 05:02:47 pgsql: Correct overflow handling in pgbench.
Previous Message Michael Paquier 2018-09-28 03:01:14 pgsql: Fix WAL recycling on standbys depending on archive_mode

Browse pgsql-hackers by date

  From Date Subject
Next Message Edmund Horner 2018-09-28 05:02:04 Re: Tid scan improvements
Previous Message Amit Langote 2018-09-28 04:02:56 Re: heap_sync seems rather oblivious to partitioned tables (wal_level=minimal)