Re: Introduce XID age and inactive timeout based replication slot invalidation - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Introduce XID age and inactive timeout based replication slot invalidation
Date
Msg-id CAD21AoCpLHEcZzZmXiC0ZyAXfO0iV+eJoFB8i3+XDLV1ci9MFA@mail.gmail.com
Whole thread Raw
In response to Re: Introduce XID age and inactive timeout based replication slot invalidation  (Nathan Bossart <nathandbossart@gmail.com>)
List pgsql-hackers
On Tue, Jul 9, 2024 at 3:01 PM Nathan Bossart <nathandbossart@gmail.com> wrote:
>
> On Mon, Jun 24, 2024 at 11:30:00AM +0530, Bharath Rupireddy wrote:
> > 6) Vacuum command can't be run on the standby in recovery. So, to help
> > invalidate replication slots on the standby, I have for now let the
> > checkpointer also do the XID age based invalidation. I know
> > invalidating both in checkpointer and vacuum may not be a great idea,
> > but I'm open to thoughts.
>
> Hm.  I hadn't considered this angle.

Another idea would be to let the startup process do slot invalidation
when replaying a RUNNING_XACTS record. Since a RUNNING_XACTS record
has the latest XID on the primary, I think the startup process can
compare it to the slot-xmin, and invalidate slots which are older than
the age limit.

Regards,

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



pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Re: format_datum debugging function
Next
From: "Euler Taveira"
Date:
Subject: Re: [Patch] add new parameter to pg_replication_origin_session_setup