Re: Introduce XID age and inactive timeout based replication slot invalidation

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Ajin Cherian <itsajin(at)gmail(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Introduce XID age and inactive timeout based replication slot invalidation
Date: 2025-01-27 10:50:05
Message-ID: CAA4eK1LiDjz+F8hEYG0_ux=rqwhxnTuWpT-RKNDWaac3w3bWNw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 27, 2025 at 11:00 AM Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> wrote:
>
> I discussed the above comments further with Peter off-list, and here
> are the v63 patches with the following changes:
> patch-001: The Assert and related comments have been updated for clarity.
>

The 0001 patch should be discussed in a separate thread as those are
general improvements that are useful even without the main patch we
are trying to achieve in this thread. I suggest we break it into three
patches (a) Ensure the same inactive_since time for all slots, (b)
Raise an error for invalid slots during ReplicationSlotAcquire(); tell
in the commit message, without this patch when such an ERROR would
have otherwise occurred, and (c) Changes in
InvalidatePossiblyObsoleteSlot(), I suggest to leave this change for
later as this impacts the core logic of invalidation.

*
@@ -812,7 +823,7 @@ ReplicationSlotAlter(const char *name, const bool *failover,
Assert(MyReplicationSlot == NULL);
Assert(failover || two_phase);

- ReplicationSlotAcquire(name, false);
+ ReplicationSlotAcquire(name, false, false);

Why don't we want to give ERROR during Alter? I think it is okay to
not give ERROR for invalid slots during Drop as we are anyway removing
such slots.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Jones 2025-01-27 10:58:43 Re: Add XMLNamespaces to XMLElement
Previous Message Peter Eisentraut 2025-01-27 09:59:04 Re: Virtual generated columns