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 <[email protected]> wrote:

> On Thu, Oct 16, 2025 at 12:47 AM Renzo Dani <[email protected]> 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
>
From 6ec4b38af5e1f5d90e8de7ef2ac073761a362b5d Mon Sep 17 00:00:00 2001
From: Renzo Dani <[email protected]>
Date: Wed, 15 Oct 2025 17:31:45 +0200
Subject: [PATCH v2 1/2] Extend documentation for
 pg_stat_replication.backend_xmin

---
 doc/src/sgml/monitoring.sgml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index dc4fc29466d..c616571e4df 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1287,6 +1287,7 @@ description | Waiting for a newly initialized WAL file to reach durable storage
       <para>
        This standby's <literal>xmin</literal> horizon reported
        by <xref linkend="guc-hot-standby-feedback"/>.
+       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>.
       </para></entry>
      </row>
 
-- 
2.43.0

From dcbf173c712437edba68a675a63d96ed5ac2f2c9 Mon Sep 17 00:00:00 2001
From: Renzo Dani <[email protected]>
Date: Thu, 16 Oct 2025 08:06:17 +0200
Subject: [PATCH v2 2/2] Extend documentation for
 pg_stat_replication.backend_xmin

Additional information for hot_standby_feedback
---
 doc/src/sgml/monitoring.sgml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index c616571e4df..d5f0fb7ba7c 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1287,7 +1287,10 @@ description | Waiting for a newly initialized WAL file to reach durable storage
       <para>
        This standby's <literal>xmin</literal> horizon reported
        by <xref linkend="guc-hot-standby-feedback"/>.
-       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>.
+       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.
       </para></entry>
      </row>
 
-- 
2.43.0

Reply via email to