| From: | Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> |
|---|---|
| To: | surya poondla <suryapoondla4(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-18 17:29:49 |
| Message-ID: | CALj2ACV=UdN+A=XjuQy_2GCNxNw_Mirtf9Zh3ohm8wTS_vVw7w@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
On Mon, Nov 9, 2026 at 3:13 PM surya poondla <suryapoondla4(at)gmail(dot)com> wrote:
>
> 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;
>
> 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)
Yeah, that's right. And that window, where users can lower the
failsafe age to avoid wraparound, can be long in some cases. This can
happen when the leader waits for the workers to finish index vacuuming
(i.e. the leader gets small indexes compared to the workers).
I don't think the fix is to keep an extra check in the leader. The
issue is that we don't pass the failsafe age down to the workers like
we do for the other cost delay params. Without it, the workers can't
honor a changed failsafe age, and lowering it can be a valid way to
avoid wraparound.
So I think a better fix is to pass the failsafe age from the leader to
the workers. That way both the leader and the workers check after each
index. If the leader is waiting for the workers and the failsafe age
changes, the workers will catch it, set the shmem flag, and the leader
will report it. So we wouldn't need an extra check in the leader.
> 2. The TAP test only counts the per-index lines. Could it also check for the "bypassing nonessential maintenance" WARNING?
Yeah, that would ensure the leader reported the detected failsafe. I
will add it.
> Apart from that, the patch behaved as expected in the other cases I tried:
Thanks for verifying.
--
Bharath Rupireddy
Amazon Web Services: https://aws.amazon.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Greg Burd | 2026-11-18 17:31:49 | Re: nbtree: opt-in leaf key prefix compression |
| Previous Message | Lukas Fittl | 2026-11-18 17:20:55 | Re: [BUG / PATCH] PG19: VACUUM misestimates reltuples (often 0) after on-access VM setting |