| From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
|---|---|
| To: | Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> |
| Cc: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com>, SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, John H <johnhyvr(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Introduce XID age based replication slot invalidation |
| Date: | 2026-08-11 14:00:40 |
| Message-ID: | CAA4eK1+5vZrQKjVUkR1W0GAR4r5af6NwK+5wn0wjRgjwu7sejw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue, Aug 11, 2026 at 6:55 AM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> Please find the attached v13 patches. I addressed all the above review comments.
>
Checking 0001 patch, I noticed:
+ * 3. The slot is not being synced from the primary while the server is in
+ * recovery. This is because synced slots are always considered to be
+ * inactive because they don't perform logical decoding to produce changes.
+ */
+static inline bool
+CanInvalidateXidAgedSlot(ReplicationSlot *s)
...
This seems to mimic the comments from CanInvalidateIdleSlot() which I
think is not correct. Because inactive_since for synced slots on
standby has no meaning as we don't allow decoding from them so they
are always inactive but I think the same is not true for their xmin
values. Even if we want to follow the core logic of idle slots, the
comments should reflect the actual cause. I feel in this case we want
to mostly rely on corresponding primary slots such that when they get
invalidated, we will sync those and invalidate synced slots.
One more thing we should consider is that synced slot's xmin can lead
to holding back xmin of primary due to hot_standby_feedback mechanism
in some cases when the sync interval is longer whereas there is no
such possibility w.r.t WAL, so is it okay to keep the same behaviour
for both max_slot_xid_age and idle_replication_slot_timeout w.r.t
synced slots? I am not sure if this is a real risk or just a
theoretical possibility but wanted to bring it to your attention so
that we can consider it.
--
With Regards,
Amit Kapila.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrey Rachitskiy | 2026-08-11 14:31:26 | Fix PGTYPESdate_fmt_asc overflow when a year does not fit "yyyy" |
| Previous Message | Bertrand Drouvot | 2026-08-11 13:50:49 | Re: pgstat: Flush some statistics within running transactions, take 2 |