Re: Introduce XID age based replication slot invalidation

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com>, SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, John H <johnhyvr(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Introduce XID age based replication slot invalidation
Date: 2026-04-06 08:44:52
Message-ID: CAD21AoArh6-RfOGGY6GfWqqHv0qUJEMwXVmGQk=29uYiKFLSgA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Apr 5, 2026 at 7:52 PM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> Hi,
>
> On Sun, Apr 5, 2026 at 1:03 AM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> >
> > Thank you for updating the patch!
> >
> > I've made some changes including moving MaybeInvalidateXidAgedSlot()
> > to vacuum.c since the function seems more inherently tied to vacuum
> > context. Also, updated the commit message and fixed typos.
> >
> > Please review the attached patch.
>
> Thank you Sawada-san!
>
> I took a look at the v10 patch and it LGTM. I tested it - make
> check-world passes, pgindent doesn't complain.
>

While reviewing the patch, I found that with this patch, backend
processes and autovacuum workers can simultaneously attempt to
invalidate the same slot for the same reason. When invalidating a
slot, we send a signal to the process owning the slot and wait for it
to exit and release the slot. If the process takes a long time to exit
for some reason, subsequent autovacuum workers attempting to
invalidate the same slot will also send a SIGTERM and get stuck at
InvalidatePossiblyObsoleteSlot(). In the worst case, this could result
in all autovacuum activity being blocked. I think we need to address
this problem.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Antonin Houska 2026-04-06 09:03:44 Re: Adding REPACK [concurrently]
Previous Message Alexandre Felipe 2026-04-06 08:29:34 Re: SLOPE - Planner optimizations on monotonic expressions.