Re: Parallel vacuum: check XID wraparound failsafe between indexes

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>
Subject: Re: Parallel vacuum: check XID wraparound failsafe between indexes
Date: 2026-10-28 17:22:47
Message-ID: CALj2ACWSQ250vO5whfeE6hXkvY7G7m-R9PTYj7knXDFJjuz4Uw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, Oct 27, 2026 at 3:24 PM Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
>
> One mostly nitpick question:

Thanks for taking a look at this.

> +extern bool parallel_vacuum_failsafe_triggered(ParallelVacuumState *pvs);
> extern void parallel_vacuum_bulkdel_all_indexes(ParallelVacuumState *pvs,
>
> parallel_vacuum_bulkdel_all_indexes now might return quietly and
> process only part of the work. Previously it either errored out, or
> completed everything. Wouldn't it be be better to give it a return
> value callers can check? Existing functions, such as
> lazy_vacuum_all_indexes already do this. In this case the current
> patch seems to be safe because of the lazy_check_wraparound_failsafe
> call, but returning the status (and handling it in vacuumlazy) seems
> like a safer not heap specific API.

Yeah, that's a good point. parallel_vacuum_bulkdel_all_indexes() can
return whether the failsafe was hit by either the leader or any of the
workers. Would something like the below work for you?

if (!parallel_vacuum_bulkdel_all_indexes(...))
{
/*
* The failsafe was hit by either the leader or one of the parallel
* workers, so do the reporting and the resetting work here, once per
* VACUUM.
*/
lazy_check_wraparound_failsafe(vacrel);
allindexes = false;

}

--
Bharath Rupireddy
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-10-28 17:31:05 Re: O(N^3) planning time in choose_plan_name() since 8c49a484e8e
Previous Message Jingtang Zhang 2026-10-28 16:44:11 Re: [PATCH] Use maintenance_io_concurrency for parallel index builds