Avoid updating inactive_since for invalid replication slots

From: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>
Subject: Avoid updating inactive_since for invalid replication slots
Date: 2025-02-03 12:03:27
Message-ID: CABdArM7QdifQ_MHmMA=Cc4v8+MeckkwKncm2Nn6tX9wSCQ-+iw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hackers,
(CC people involved in the earlier discussion)

Right now, it is possible for the 'inactive_since' value of an invalid
replication slot to be updated multiple times, which is unexpected
behavior.
As suggested in the ongoing thread [1], this patch introduces a new
dedicated function to update the inactive_since for a given
replication slot, and ensures that inactive_since is not updated for
an invalid replication slot.

The v1 patch is attached. Any feedback would be appreciated.

[1] https://www.postgresql.org/message-id/CAA4eK1L6A-RC2PkqAFjgmmmS6_vKxrLsG33vdJzeeRKBP8RbOA%40mail.gmail.com

--
Thanks,
Nisha

Attachment Content-Type Size
v1-0001-Avoid-updating-inactive_since-for-invalid-replica.patch application/octet-stream 4.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nisha Moond 2025-02-03 12:05:22 Re: Introduce XID age and inactive timeout based replication slot invalidation
Previous Message Alena Rybakina 2025-02-03 11:54:47 Re: POC, WIP: OR-clause support for indexes