Hi,

On Sat, Oct 17, 2026 at 12:27 PM Sami Imseih <[email protected]> wrote:
>
> There was probably little incentive to do this for manual VACUUM. Since
> v12, users have been able to disable the main nonessential work
> themselves, e.g. with INDEX_CLEANUP off, TRUNCATE off, etc.

Yes, that's correct. I think it will be more useful for parallel
autovacuum at scale (hundreds of GBs table and indexes) with default
cost delay and cost limit.

> > I chose to set the shared flag in the parallel worker or leader that
> > detects the failsafe, instead of having each one check the failsafe on
> > its own, to avoid taking XidGenLock and MultiXactGenLock so often.
>
> I think the shared flag is the right way. Without it, the only other
> viable place to
> do a recheck would be vacuum_delay_point(), which as you say would mean
> repeatedly taking XidGenLock and MultiXactGenLock locks. I do not think that
> is a good idea.

Right.

> One logging caveat I noticed while testing is that per-index
> VERBOSE/log_autovacuum lines can include indexes vacuumed in an earlier
> pass of the same VACUUM, even if those indexes were skipped in the pass
> in which failsafe is triggered. This is current behavior, so I do not think
> there is anything to do here.

Yeah, that requires some additional tracking and I don't think it's
worth the complexity just for logging.

> But I would suggest one small comment tweak.

Agreed. That looks confusing. I changed it to the following:

        /*
         * Reset all index status back to initial (while checking that we have
-        * vacuumed all indexes).
+        * vacuumed all indexes). Indexes not yet started when the failsafe
+        * triggered are skipped, so those are still NEED_BULKDELETE
here and that
+        * is expected.
         */

> The test also looks necessary to me. No comments on that.

Thanks for reviewing. Please find the attached v2 patch with the above
comment rewording. CF entry:
https://commitfest.postgresql.org/patch/7490/.

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

Attachment: v2-0001-Check-XID-wraparound-failsafe-between-indexes-in-.patch
Description: Binary data

Reply via email to