Re: Introduce XID age based replication slot invalidation

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, 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-08-18 05:45:57
Message-ID: CAA4eK1LsFi7GWtwtKwQm1kxgJWz_GvyDNSaO8=gr1zocPni-+g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 13, 2026 at 5:32 AM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> On Tue, Aug 11, 2026 at 7:00 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> > so is it okay to keep the same behaviour
> > for both max_slot_xid_age and idle_replication_slot_timeout w.r.t
> > synced slots? I am not sure if this is a real risk or just a
> > theoretical possibility but wanted to bring it to your attention so
> > that we can consider it.
>
> I believe this can happen in practice (as explained above). IMHO, XID
> age based slot invalidation must invalidate the synced slot on the
> standby (just like other invalidations except the idle-timeout based)
> if its catalog_xmin is aged and blocking vacuum on the primary.
>

Fair enough, then let's invalidate synced slots as well on standby due
to xid_age but I think it is better to let users build some alerting
system before these slots get invalidated. We can add a column similar
to wal_status in pg_replication_slots which could help users to
indicate that the particular slot is in danger of invalidation.
Additionally, for synced slots, we could add a LOG/WARNING when they
are nearing invalidation as there are no direct consumers for the
same.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-08-18 05:46:45 Re: pg_stat_database.checksum_failures misses single-page failures in backups
Previous Message Tender Wang 2026-08-18 05:40:18 Re: [BUG] hstore integer overflow when constructing large values