Re: Making autovacuum logs indicate if insert-based threshold was the triggering condition - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Making autovacuum logs indicate if insert-based threshold was the triggering condition
Date
Msg-id CAH2-Wz=FUf3wfCxmYhy5wmYqUmYzT8iKxaopNbcbvNWQHHPVRw@mail.gmail.com
Whole thread Raw
In response to Re: Making autovacuum logs indicate if insert-based threshold was the triggering condition  (Justin Pryzby <pryzby@telsasoft.com>)
Responses Re: Making autovacuum logs indicate if insert-based threshold was the triggering condition
List pgsql-hackers
On Sat, Aug 6, 2022 at 3:51 PM Justin Pryzby <pryzby@telsasoft.com> wrote:
> > Well, autovacuum.c should have (and/or kind of already has) 3
> > different triggering conditions. These are mutually exclusive
> > conditions -- technically autovacuum.c always launches an autovacuum
> > against a table because exactly 1 of the 3 thresholds were crossed.
>
> The issue being that both thresholds can be crossed:
>
> >> 2022-08-06 16:47:47.674 CDT autovacuum worker[12707] DEBUG:  t: VAC: 99999 (THRESHOLD 50), INS: 99999 (THRESHOLD
1000),anl: 199998 (threshold 50)
 

What are the chances that both thresholds will be crossed at *exactly*
(not approximately) the same time in a real world case, where the
table isn't tiny (tiny relative to the "autovacuum_naptime quantum")?
This is a very narrow case.

Besides, the same can already be said with how autovacuum.c crosses
the XID-based antiwraparound threshold. Yet we still arbitrarily
report that it's antiwraparound in the logs, which (at least right
now) is generally assumed to mostly be about advancing relfrozenxid.
(Or maybe it's the other way around; it doesn't matter.)

It might make sense to *always* show how close we were to hitting each
of the thresholds, including the ones that we didn't end up hitting
(we may come pretty close quite often, which seems like it might
matter). But showing multiple conditions together just because the
planets aligned (we hit multiple thresholds together) emphasizes the
low-level mechanism, which is pretty far removed from anything that
matters. You might as well pick either threshold at random once this
happens -- even an expert won't be able to tell the difference.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: failing to build preproc.c on solaris with sun studio
Next
From: Thomas Munro
Date:
Subject: Re: Cleaning up historical portability baggage