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

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, Peter Smith <smithpb2250(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-02-06 13:56:33
Message-ID: CALDaNm3wx8ihfkidveKuK=gGujS_yc9sEgq6ev-T+W3zeHM88g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 6 Feb 2025 at 16:08, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> wrote:
> Here are the v71 patches with the above comments incorporated.

Few comments:
1) While changing the switch to an if condition, the behavior of the
break statement has changed. Previously, it would exit the switch, but
now it exits the main for loop without releasing the locks. These
should be replaced with a goto to ensure the locks are properly
released.
+ if (cause & RS_INVAL_HORIZON)
+ {
+ if (!SlotIsLogical(s))
break;
- case RS_INVAL_WAL_LEVEL:
- if (SlotIsLogical(s))
- invalidation_cause = cause;
+ /* invalid DB oid signals a shared relation */
+ if (dboid != InvalidOid && dboid !=
s->data.database)
break;

2) None of this initialization is required, as we will be setting
these values before using it:
+ int minutes = 0;
+ int secs = 0;
+ long elapsed_secs = 0;

Regards,
Vignesh

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2025-02-06 14:43:17 Re: Docs for pg_basebackup needs v17 note for incremental backup
Previous Message Daniel Gustafsson 2025-02-06 13:23:33 Re: SLRU_PAGES_PER_SEGMENT as configure parameter