Extend documentation for pg_stat_replication.backend_xmin

Started by Renzo Dani5 months ago5 messages
Jump to latest
#1Renzo Dani
arons7@gmail.com

Hi,
recently I had some issue understanding what was going on with a replica
and the reported xmin.
I have than created a patch to better specify the value expected into
the pg_stat_replication.backend_xmin field.

Regards,
Renzo Dani

Attachments:

0001-Extend-documentation-for-pg_stat_replication.backend.patchtext/x-patch; charset=US-ASCII; name=0001-Extend-documentation-for-pg_stat_replication.backend.patchDownload+1-1
#2Fujii Masao
masao.fujii@gmail.com
In reply to: Renzo Dani (#1)
Re: Extend documentation for pg_stat_replication.backend_xmin

On Thu, Oct 16, 2025 at 12:47 AM Renzo Dani <arons7@gmail.com> wrote:

Hi,
recently I had some issue understanding what was going on with a replica and the reported xmin.
I have than created a patch to better specify the value expected into the pg_stat_replication.backend_xmin field.

+1

+ This field will be null if a replication slot is used; in that
case, the xmin is available through <link
linkend="view-pg-replication-slots">pg_replication_slots</link>.

I think it would be better to also mention that this field is null
when hot_standby_feedback is disabled.

Also, <literal> tags should be used for "xmin", and a newline should
be added to avoid an overly long line.

Based on the above comments, how about revising it as follows?

+       This field will be null if a replication slot is used (in this case,
+       the standby's <literal>xmin</literal> is shown in
+       <link linkend="view-pg-replication-slots">pg_replication_slots</link>)
+       or if <varname>hot_standby_feedback</varname> is disabled.

Regards,

--
Fujii Masao

#3Renzo Dani
arons7@gmail.com
In reply to: Fujii Masao (#2)
Re: Extend documentation for pg_stat_replication.backend_xmin

Really nice,
Thanks a lot for the info and review.
Taken into the patch.

Regards,
Renzo Dani

On Thu, Oct 16, 2025 at 5:32 AM Fujii Masao <masao.fujii@gmail.com> wrote:

Show quoted text

On Thu, Oct 16, 2025 at 12:47 AM Renzo Dani <arons7@gmail.com> wrote:

Hi,
recently I had some issue understanding what was going on with a replica

and the reported xmin.

I have than created a patch to better specify the value expected into

the pg_stat_replication.backend_xmin field.

+1

+ This field will be null if a replication slot is used; in that
case, the xmin is available through <link
linkend="view-pg-replication-slots">pg_replication_slots</link>.

I think it would be better to also mention that this field is null
when hot_standby_feedback is disabled.

Also, <literal> tags should be used for "xmin", and a newline should
be added to avoid an overly long line.

Based on the above comments, how about revising it as follows?

+       This field will be null if a replication slot is used (in this
case,
+       the standby's <literal>xmin</literal> is shown in
+       <link
linkend="view-pg-replication-slots">pg_replication_slots</link>)
+       or if <varname>hot_standby_feedback</varname> is disabled.

Regards,

--
Fujii Masao

Attachments:

v2-0001-Extend-documentation-for-pg_stat_replication.back.patchtext/x-patch; charset=US-ASCII; name=v2-0001-Extend-documentation-for-pg_stat_replication.back.patchDownload+1-1
v2-0002-Extend-documentation-for-pg_stat_replication.back.patchtext/x-patch; charset=US-ASCII; name=v2-0002-Extend-documentation-for-pg_stat_replication.back.patchDownload+4-2
#4Renzo Dani
arons7@gmail.com
In reply to: Renzo Dani (#3)
Re: Extend documentation for pg_stat_replication.backend_xmin

On Thu, Oct 16, 2025 at 8:07 AM Renzo Dani <arons7@gmail.com> wrote:

Really nice,
Thanks a lot for the info and review.
Taken into the patch.

Regards,
Renzo Dani

On Thu, Oct 16, 2025 at 5:32 AM Fujii Masao <masao.fujii@gmail.com> wrote:

On Thu, Oct 16, 2025 at 12:47 AM Renzo Dani <arons7@gmail.com> wrote:

Hi,
recently I had some issue understanding what was going on with a

replica and the reported xmin.

I have than created a patch to better specify the value expected into

the pg_stat_replication.backend_xmin field.

+1

+ This field will be null if a replication slot is used; in that
case, the xmin is available through <link
linkend="view-pg-replication-slots">pg_replication_slots</link>.

I think it would be better to also mention that this field is null
when hot_standby_feedback is disabled.

Also, <literal> tags should be used for "xmin", and a newline should
be added to avoid an overly long line.

Based on the above comments, how about revising it as follows?

+       This field will be null if a replication slot is used (in this
case,
+       the standby's <literal>xmin</literal> is shown in
+       <link
linkend="view-pg-replication-slots">pg_replication_slots</link>)
+       or if <varname>hot_standby_feedback</varname> is disabled.

Regards,

--
Fujii Masao

I think I did it the wrong way with the patches.
So here again with all in one file.
Sorry for that.

Regards
Renzo

Attachments:

v3-0001-Extend-documentation-for-pg_stat_replication.back.patchtext/x-patch; charset=US-ASCII; name=v3-0001-Extend-documentation-for-pg_stat_replication.back.patchDownload+4-1
#5Fujii Masao
masao.fujii@gmail.com
In reply to: Renzo Dani (#4)
Re: Extend documentation for pg_stat_replication.backend_xmin

On Thu, Oct 16, 2025 at 3:28 PM Renzo Dani <arons7@gmail.com> wrote:

I think I did it the wrong way with the patches.
So here again with all in one file.

Thanks for updating the patch! I've pushed the patch.

Regards,

--
Fujii Masao