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

From: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: shveta malik <shveta(dot)malik(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(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: 2024-11-29 12:36:02
Message-ID: CABdArM45=j=DAFTEZA8p=oqYo-XqRwhaPCdKpciQCJx+jNeTJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 28, 2024 at 2:44 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> >
> > We are setting inactive_since when the replication slot is released.
> > We are marking the slot as inactive only if it has been released.
> > However, there's a scenario where the network connection between the
> > publisher and subscriber may be lost where the replication slot is not
> > released, but no changes are replicated due to the network problem. In
> > this case, no updates would occur in the replication slot for a period
> > exceeding the replication_slot_inactive_timeout.
> > Should we invalidate these replication slots as well, or is it
> > intentionally left out?
>
> On further thinking, I felt we can keep the current implementation as
> is and simply add a brief comment in the code to address this.
> Additionally, we can mention it in the commit message for clarity.
>

Thank you for the clarification. I’ve included the explanatory comment
in patch-002.

Attached the v52 patch-set addressing above as well as all other
comments till now in [1], [2], [3], and [4].

[1] https://www.postgresql.org/message-id/CAHut%2BPto1Yz9Fqp07LLP9uvx3sRHe5SOUKuFM1sUF9QA5aLfBA%40mail.gmail.com
[2] https://www.postgresql.org/message-id/CAHut%2BPs%3DH6EBO1ssGfykrJfUQQGh76L0eKuU5XkR9GMs96ZT3g%40mail.gmail.com
[3] https://www.postgresql.org/message-id/TYAPR01MB56927564EEE26E5433198405F5292%40TYAPR01MB5692.jpnprd01.prod.outlook.com
[4] https://www.postgresql.org/message-id/CALDaNm1F2YrswzM_WM37BYmiZ9Cf60UD_mgtm8HnMHRGA7tx4g%40mail.gmail.com

--
Thanks,
Nisha

Attachment Content-Type Size
v52-0001-Enhance-replication-slot-error-handling-slot-inv.patch application/octet-stream 10.3 KB
v52-0002-Introduce-inactive_timeout-based-replication-slo.patch application/octet-stream 28.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nisha Moond 2024-11-29 12:36:33 Re: Introduce XID age and inactive timeout based replication slot invalidation
Previous Message David Rowley 2024-11-29 12:01:28 Re: Added prosupport function for estimating numeric generate_series rows