On Mon, Sep 2, 2024 at 5:47 AM Peter Smith <smithpb2250@gmail.com> wrote:
>
> Hi hackers. While reviewing another thread I had cause to look at the
> docs for the pg_replication_slot 'inactive_since' field [1] for the
> first time.
>
> I was confused by the description, which is as follows:
> ----
> inactive_since timestamptz
> The time since the slot has become inactive. NULL if the slot is
> currently being used.
> ----
>
> Then I found the github history for the patch [2], and the
> accompanying long thread discussion [3] about the renaming of that
> field. I have no intention to re-open that can-of-worms, but OTOH I
> feel the first sentence of the field description is wrong and needs
> fixing.
>
> Specifically, IMO describing something as "The time since..." means
> some amount of elapsed time since some occurrence, but that is not the
> correct description for this timestamp field.
>
> This is not just a case of me being pedantic. For example, here is
> what Chat-GPT had to say:
> ----
> I asked:
> What does "The time since the slot has become inactive." mean?
>
> ChatGPT said:
> "The time since the slot has become inactive" refers to the duration
> that has passed from the moment a specific slot (likely a database
> replication slot or a similar entity) stopped being active. In other
> words, it measures how much time has elapsed since the slot
> transitioned from an active state to an inactive state.
>
> For example, if a slot became inactive 2 hours ago, "the time since
> the slot has become inactive" would be 2 hours.
> ----
>
> To summarize, the current description wrongly describes the field as a
> time duration:
> "The time since the slot has become inactive."
>
> I suggest replacing it with:
> "The slot has been inactive since this time."
>
+1 for the change. If I had read the document without knowing about
the patch, I too would have interpreted it as a duration.
thanks
Shveta