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: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(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>, Peter Smith <smithpb2250(at)gmail(dot)com>
Subject: Re: Introduce XID age and inactive timeout based replication slot invalidation
Date: 2025-02-10 13:27:25
Message-ID: CABdArM701NkPN0uRn54v3VxztXg-f6Hu0esyqC9x+sNabn=G8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 10, 2025 at 6:12 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> On Mon, 10 Feb 2025 at 17:33, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> wrote:
> >
> > Here are the v73 patches incorporating the comments above and the
> > subsequent comments from [1].
> > - patch 002 is rebased on 001 with no new changes.
>
> Few comments:
> 1) For some reason SlotInvalidationCauses was with PGDLLIMPORT, this
> is removed now. This is required if it needs to be accessible by
> loaded modules. Is there any impact or is it ok?
> -extern PGDLLIMPORT const char *const SlotInvalidationCauses[];
> +typedef struct SlotInvalidationCauseMap
> +{
> + int cause;
> + const char *cause_name;
> +} SlotInvalidationCauseMap;
>
> 2) The new structure should be added to typedefs.list:
> +typedef struct SlotInvalidationCauseMap
> +{
> + int cause;
> + const char *cause_name;
> +} SlotInvalidationCauseMap;
>
> 3) After adding you can run pgindent on slot.h to indent the following code:
> +typedef struct SlotInvalidationCauseMap
> +{
> + int cause;
> + const char *cause_name;
> +} SlotInvalidationCauseMap;
>

Addressed above comments, please find the attached v74 patches.
Also, corrected the type of parameter "possible_causes" to 'uint32' in
InvalidateObsoleteReplicationSlots() and
InvalidatePossiblyObsoleteSlot().

--
Thanks,
Nisha

Attachment Content-Type Size
v74-0001-Introduce-inactive_timeout-based-replication-slo.patch application/octet-stream 30.7 KB
v74-0002-Add-TAP-test-for-slot-invalidation-based-on-inac.patch application/octet-stream 6.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-02-10 13:31:38 Re: RFC: Allow EXPLAIN to Output Page Fault Information
Previous Message torikoshia 2025-02-10 13:23:06 Re: RFC: Allow EXPLAIN to Output Page Fault Information