Thread

  1. Re: Add mode column to pg_stat_progress_vacuum

    Robert Treat <rob@xzilla.net> — 2025-10-07T15:50:46Z

    On Tue, Oct 7, 2025 at 11:04 AM Nathan Bossart <nathandbossart@gmail.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