Documentation issue with pg_stat_recovery_prefetch

Started by sirisha chamarthialmost 4 years ago3 messages
#1sirisha chamarthi
sirichamarthi22@gmail.com
1 attachment(s)

Hi,

I was going through pg_stat_recovery_prefetch documentation and saw an
issue with formatting. Attached a small patch to fix the issue. This is the
first time I am sending an email to hackers. Please educate me if I
miss something.

https://www.postgresql.org/docs/devel/monitoring-stats.html#PG-STAT-RECOVERY-PREFETCH-VIEW

Thanks,
Sirisha

Attachments:

0001-Fix-documentation-bug-for-pg_stat_recovery_prefetch.patchapplication/octet-stream; name=0001-Fix-documentation-bug-for-pg_stat_recovery_prefetch.patchDownload
From c9028b18da2668e7fbd8da08b2b4f0a57ec419fa Mon Sep 17 00:00:00 2001
From: Sirisha Chamarthi <sirichamarthi22@gmail.com>
Date: Mon, 11 Apr 2022 13:02:35 -0700
Subject: [PATCH] Fix documentation bug for pg_stat_recovery_prefetch

---
 doc/src/sgml/monitoring.sgml | 35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 87b6e5fb5e..42ef9fa053 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -336,7 +336,8 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
      <row>
       <entry><structname>pg_stat_recovery_prefetch</structname><indexterm><primary>pg_stat_recovery_prefetch</primary></indexterm></entry>
       <entry>Only one row, showing statistics about blocks prefetched during recovery.
-       See <xref linkend="pg-stat-recovery-prefetch-view"/> for details.
+       See <link linkend="monitoring-pg-stat-recovery-prefetch">
+       <structname>pg_stat_recovery_prefetch</structname></link> for details.
       </entry>
      </row>
 
@@ -2977,18 +2978,20 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
 
  </sect2>
 
- <sect2 id="monitoring-pg-stat-subscription">
-  <title><structname>pg_stat_subscription</structname></title>
+ <sect2 id="monitoring-pg-stat-recovery-prefetch">
+  <title><structname>pg_stat_recovery_prefetch</structname></title>
 
   <indexterm>
-   <primary>pg_stat_subscription</primary>
+   <primary>pg_stat_recovery_prefetch</primary>
   </indexterm>
 
   <para>
-   The <structname>pg_stat_subscription</structname> view will contain one
-   row per subscription for main worker (with null PID if the worker is
-   not running), and additional rows for workers handling the initial data
-   copy of the subscribed tables.
+   The <structname>pg_stat_recovery_prefetch</structname> view will contain
+   only one row.  The columns <structfield>wal_distance</structfield>,
+   <structfield>block_distance</structfield> and
+   <structfield>io_depth</structfield> show current values, and the
+   other columns show cumulative counters that can be reset
+   with the <function>pg_stat_reset_shared</function> function.
   </para>
 
   <table id="pg-stat-recovery-prefetch-view" xreflabel="pg_stat_recovery_prefetch">
@@ -3052,14 +3055,14 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
    </tgroup>
   </table>
 
-  <para>
-   The <structname>pg_stat_recovery_prefetch</structname> view will contain
-   only one row.  The columns <structfield>wal_distance</structfield>,
-   <structfield>block_distance</structfield> and
-   <structfield>io_depth</structfield> show current values, and the
-   other columns show cumulative counters that can be reset
-   with the <function>pg_stat_reset_shared</function> function.
-  </para>
+ </sect2>
+
+ <sect2 id="monitoring-pg-stat-subscription">
+  <title><structname>pg_stat_subscription</structname></title>
+
+  <indexterm>
+   <primary>pg_stat_subscription</primary>
+  </indexterm>
 
   <table id="pg-stat-subscription" xreflabel="pg_stat_subscription">
    <title><structname>pg_stat_subscription</structname> View</title>
-- 
2.35.1.windows.2

#2Thomas Munro
thomas.munro@gmail.com
In reply to: sirisha chamarthi (#1)
Re: Documentation issue with pg_stat_recovery_prefetch

On Tue, Apr 12, 2022 at 8:11 AM sirisha chamarthi
<sirichamarthi22@gmail.com> wrote:

I was going through pg_stat_recovery_prefetch documentation and saw an issue with formatting. Attached a small patch to fix the issue. This is the first time I am sending an email to hackers. Please educate me if I miss something.

Thanks Sirisha!

Ouch, that's embarrassing. My best guess is that I might have screwed
that up a long time ago while rebasing an early development version
over commit 92f94686, which changed the link style and moved
paragraphs around, and then never noticed that it was wrong.
Researching that made me notice another problem: the table was using
the 3 column layout from a couple of years ago, because I had also
missed the style change in commit a0427506. Oops. Fixed.

#3Shinoda, Noriyoshi (PN Japan FSIP)
noriyoshi.shinoda@hpe.com
In reply to: Thomas Munro (#2)
1 attachment(s)
RE: Documentation issue with pg_stat_recovery_prefetch

Hi,

Thank you for developing the new feature.
The pg_stat_recovery_prefetch view documentation doesn't seem to have a description of the stats_reset column. The attached small patch adds a description of the stats_reset column.

Regards,
Noriyoshi Shinoda

-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Tuesday, April 12, 2022 6:23 PM
To: sirisha chamarthi <sirichamarthi22@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Documentation issue with pg_stat_recovery_prefetch

On Tue, Apr 12, 2022 at 8:11 AM sirisha chamarthi <sirichamarthi22@gmail.com> wrote:

I was going through pg_stat_recovery_prefetch documentation and saw an issue with formatting. Attached a small patch to fix the issue. This is the first time I am sending an email to hackers. Please educate me if I miss something.

Thanks Sirisha!

Ouch, that's embarrassing. My best guess is that I might have screwed that up a long time ago while rebasing an early development version over commit 92f94686, which changed the link style and moved paragraphs around, and then never noticed that it was wrong.
Researching that made me notice another problem: the table was using the 3 column layout from a couple of years ago, because I had also missed the style change in commit a0427506. Oops. Fixed.

Attachments:

pg_stat_recovery_prefetch_doc_v1.diffapplication/octet-stream; name=pg_stat_recovery_prefetch_doc_v1.diffDownload
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 180798a..77ee01a 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -3012,6 +3012,17 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
      <row>
       <entry role="catalog_table_entry">
        <para role="column_definition">
+        <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
+       </para>
+       <para>
+        Time at which these statistics were last reset
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
         <structfield>prefetch</structfield> <type>bigint</type>
        </para>
        <para>