Re: Parallel vacuum: check XID wraparound failsafe between indexes

From: surya poondla <suryapoondla4(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Parallel vacuum: check XID wraparound failsafe between indexes
Date: 2026-11-09 23:13:39
Message-ID: CAOVWO5rjK3JEpcJhrnfgtae0yv3aAsyzeW0F-JUyeKOHZ9mmeQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Bharath,

Thank you for the patch, I tested v3 on top of c074737f687.

I have a few comments:
1. v3 now runs lazy_check_wraparound_failsafe() after the parallel index
pass only when the shared flag is set; master (and v1/v2) ran it
unconditionally. Was dropping it intentional? It's cheap, and it still
matters in one corner case which is parallel workers use the GUC values
serialized when the parallel context was set up, while an autovacuum
leader can reload vacuum_failsafe_age while it waits for them. If
vacuum_failsafe_age is lowered at that point, only the leader's recheck
would notice it. I can share a reproducer if that's useful (doesn't happen
in normal scenarios)

2. The TAP test only counts the per-index lines. Could it also check for
the "bypassing nonessential maintenance" WARNING? That confirms the
leader actually entered failsafe mode, not just that indexes were skipped.

Apart from that, the patch behaved as expected in the other cases I tried:
i) manual VACUUM (VERBOSE, PARALLEL 2) with 6 indexes: 3 vacuumed, 3
skipped, WARNING emitted, index reltuples left untouched;
ii) leader-only indexes (below min_parallel_index_scan_size) mixed with
parallel ones: the remaining leader-only and parallel indexes are both
skipped once the flag is set;
iii) failsafe triggered in the second index pass (maintenance_work_mem =
512kB): no "parallel index vacuum on index ... is not completed"
error, and the WARNING says "after 1 index scans";
iv) workers planned but none launched (max_parallel_workers = 0): the
leader sets the flag itself and skips the rest.

Regards,
Surya Poondla

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Andrei Lepikhov 2026-11-09 22:59:40 Re: Show 'Rows Removed by Filter' with two fractional digits in EXPLAIN