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

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, 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>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Improve autovacuum logging for aggressive and anti-wraparound ru
Date: 2018-10-02 04:18:01
Message-ID: CAD21AoB-nhVxo=6__BeukNniHnt6UGMKRs3v=Zkn-WJq9kx+4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, Oct 2, 2018 at 9:11 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Fri, Sep 28, 2018 at 01:53:14PM +0900, Masahiko Sawada wrote:
> > I agree. Can we fix this simply by the attached patch?
>
> Thanks for sending a patch.
>
> + /* autovacuum cannot be anti-wraparound and not aggressive vacuum */
> + Assert(aggressive);
> + msgfmt = _("automatic aggressive vacuum to prevent wraparound of table \"%s.%s.%s\": index scans: %d\n");
>
> While adding this comment in lazy_vacuum_rel() is adapted, I think that
> we ought to make the assertion check more aggressive by not having it
> depend on if log_min_duration is set or not. So why not moving that to
> a place a bit higher, where aggressive gets defined?

Since there is no place where checks params->is_wraparound we will
have to do something like;

if (params->is_wraparound)
Assert(aggressive);

Or you meant the following?

Assert(params->is_wraparound ? aggressive : true);

I'm not sure both styles would be appropriate style in the postgres
code so I would rather add elog(ERROR) instead. Thought?

Regards,

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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2018-10-02 05:37:49 pgsql: Test passing expanded-value representations to workers.
Previous Message Tom Lane 2018-10-02 00:52:41 Re: pgsql: Add assertions that we hold some relevant lock during relation o

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2018-10-02 04:26:37 Re: SerializeParamList vs machines with strict alignment
Previous Message Tom Lane 2018-10-02 04:08:06 Re: SerializeParamList vs machines with strict alignment