Re: Add mode column to pg_stat_progress_vacuum

From: Robert Treat <rob(at)xzilla(dot)net>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Shinya Kato <shinya11(dot)kato(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add mode column to pg_stat_progress_vacuum
Date: 2025-10-07 15:50:46
Message-ID: CABV9wwOCC2X4cUT6ZAn4cT+k9KC=NAycPCw=BqF3jM8+X-v=PA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 7, 2025 at 11:04 AM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
> On Thu, Aug 14, 2025 at 08:12:55PM +0900, Shinya Kato wrote:
> > I would like to propose a patch that enhances the
> > pg_stat_progress_vacuum view by adding a mode column. The patch is
> > attached.
> >
> > Although it is possible to identify an anti-wraparound VACUUM through
> > the process title (to prevent wraparound) or specific log entries, it
> > would be significantly more convenient for monitoring purposes to have
> > this status clearly indicated in the pg_stat_progress_vacuum view.
> > This would enable DBAs to immediately understand the urgency of the
> > vacuum process without needing to check separate logs or system
> > processes.
>
> This seems generally reasonable to me.
>

There is a bit of an issue that an anti-wraparound vacuum is not in
and of itself urgent, especially not with our defaults, so I have a
little bit of concern that this patch could be mis-leading, but that
isn't exactly an argument against the merits of it.

> > This patch introduces a mode column to provide this visibility. The
> > possible values are:
> > - normal: A standard, user-initiated VACUUM or a regular autovacuum run.
> > - anti-wraparound: An autovacuum run launched specifically to prevent
> > transaction ID wraparound.
> > - failsafe: A vacuum that has entered failsafe mode to prevent
> > imminent transaction ID wraparound.
>

I think we should probably split out manual vacuums, which can be run
for a whole host of different reasons. I'd suggest a mode of "manual"
for those, and probably "standard" for a regular autovacuum run.

> I wonder if we should also add "aggressive".
>

I don't think so. I feel like the point of the mode is to answer "why
is this vacuum running" not "how is it operating under the hood".

Robert Treat
https://xzilla.net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2025-10-07 16:17:47 Re: Should we update the random_page_cost default value?
Previous Message Robert Treat 2025-10-07 15:37:54 Re: Should we update the random_page_cost default value?