Re: DOCS - pg_replication_slot . Fix the 'inactive_since' description

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: DOCS - pg_replication_slot . Fix the 'inactive_since' description
Date: 2024-09-02 03:43:48
Message-ID: CAJpy0uC6bDq9FhjGP8DnvRgoem1n3Z3ketZKKBg8zi=BMng1DQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 2, 2024 at 5:47 AM Peter Smith <smithpb2250(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2024-09-02 04:42:37 Re: long-standing data loss bug in initial sync of logical replication
Previous Message torikoshia 2024-09-02 03:29:37 Re: ANALYZE ONLY