Re: Unifying VACUUM VERBOSE and log_autovacuum_min_duration output

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Unifying VACUUM VERBOSE and log_autovacuum_min_duration output
Date: 2022-01-06 18:21:32
Message-ID: CAH2-WzmiWbTukdUwG7J51Wv0HyZ7kFwFH4pwHe_ZaFC4W582hw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 21, 2021 at 11:57 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> I've looked at the patch and here are comments:

Thanks!

The patch bitrot again, so attached is a rebased version, v3.

> I think we should set message_level. Otherwise, index AM will set an
> invalid log level, although any index AM in core seems not to use it.

Fixed.

> ---
> - /*
> - * Update error traceback information. This is the
> last phase during
> - * which we add context information to errors, so we
> don't need to
> - * revert to the previous phase.
> - */
>
> Why is this comment removed? ISTM this comment is still valid.

We don't "revert to the previous phase" here, which is always
VACUUM_ERRCB_PHASE_SCAN_HEAP in practice, per the comment -- but that
doesn't seem significant. It's not just unnecessary to do so, as the
comment claims -- it actually seems *wrong*. That is, it would be
wrong to go back to VACUUM_ERRCB_PHASE_SCAN_HEAP here, since we're
completely finished scanning the heap at this point.

There is still perhaps a small danger that somebody will forget to add
a new VACUUM_ERRCB_PHASE_* for some new kind of work that happens
after this point, at the very last moment. But that would be equally
true if the new kind of work took place earlier, inside
lazy_scan_heap(). And so the last call to update_vacuum_error_info()
isn't special compared to any other update_vacuum_error_info() call
(or any other call that doesn't set a saved_err_info).

--
Peter Geoghegan

Attachment Content-Type Size
v3-0001-Unify-VACUUM-VERBOSE-and-log_autovacuum_min_durat.patch application/octet-stream 17.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2022-01-06 18:24:49 Re: Deduplicate min restart_lsn calculation code
Previous Message Tom Lane 2022-01-06 18:13:46 Re: psql: \dl+ to list large objects privileges