Re: Introduce XID age and inactive timeout based replication slot invalidation - Mailing list pgsql-hackers

From vignesh C
Subject Re: Introduce XID age and inactive timeout based replication slot invalidation
Date
Msg-id CALDaNm3wx8ihfkidveKuK=gGujS_yc9sEgq6ev-T+W3zeHM88g@mail.gmail.com
Whole thread Raw
In response to Re: Introduce XID age and inactive timeout based replication slot invalidation  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
On Thu, 6 Feb 2025 at 16:08, Nisha Moond <nisha.moond412@gmail.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



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: SLRU_PAGES_PER_SEGMENT as configure parameter
Next
From: "David G. Johnston"
Date:
Subject: Re: Docs for pg_basebackup needs v17 note for incremental backup