On Wed, Aug 19, 2026 at 1:13 AM Bharath Rupireddy
<[email protected]> wrote:
>
> On Mon, Aug 17, 2026 at 10:46 PM Amit Kapila <[email protected]> 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
>
> Thanks. I will post the new patches soon.
>
> > 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.
>
> My initial thought is that one can derive such information using the
> existing slot's xmin and catalog_xmin columns along with the
> max_slot_xid_age GUC value, something like [1], and create alarms if
> needed.
>

This works for me.

> XID-age based replication slot invalidation doesn't have intermediate
> phases like WAL-based invalidation does, so wal_status makes sense for
> WAL-based invalidation but may not be as applicable here.
>
> That said, I'm open to other thoughts on this.
>
> > Additionally, for synced slots, we could add a LOG/WARNING when they
> > are nearing invalidation as there are no direct consumers for the
> > same.
>
> That's an interesting idea. I see this as useful not just for XID-age
> based invalidation but for slot invalidation in general. Having some
> warning before a slot gets invalidated, something like when the
> database approaches XID wraparound limits, whether built into core or
> via a documented SQL query, would be nice to have. It's worth
> discussing separately.
>

I thought for synced slots, it is important as there is no active
consumer for them.

-- 
With Regards,
Amit Kapila.


Reply via email to