From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
---|---|
To: | Peter Smith <smithpb2250(at)gmail(dot)com> |
Cc: | Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(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> |
Subject: | Re: Introduce XID age and inactive timeout based replication slot invalidation |
Date: | 2025-02-11 06:17:34 |
Message-ID: | CAA4eK1LuvXa6sVj3xuLoe2X=0xjbJXrnJePbpXQZaTMws8pZqg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Feb 11, 2025 at 8:49 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
>
> InvalidatePossiblyObsoleteSlot:
>
> 2.
> + if (possible_causes & RS_INVAL_IDLE_TIMEOUT)
> + {
> + /*
> + * Assign the current time here to avoid system call overhead
> + * while holding the spinlock in subsequent code.
> + */
> + now = GetCurrentTimestamp();
> + }
> +
>
> I felt that any minuscule benefit gained from having this conditional
> 'now' assignment is outweighed by the subsequent confusion/doubt
> caused by passing around a 'now' to other functions where it may or
> may not still be zero depending on different processing. IMO we should
> just remove all doubts and always assign it so that "now always means
> now".
>
I think we shouldn't pass now to another function, but rather do all
required computations in the caller (probably in a separate inline
function). And keep the above code as is.
--
With Regards,
Amit Kapila.
From | Date | Subject | |
---|---|---|---|
Next Message | jian he | 2025-02-11 06:39:12 | Re: read stream on amcheck |
Previous Message | Zhijie Hou (Fujitsu) | 2025-02-11 06:12:31 | RE: Introduce XID age and inactive timeout based replication slot invalidation |