pgsql: New system view pg_stat_replication displays activity of wal sen

Started by Itagaki Takahiroabout 15 years ago6 messages
#1Itagaki Takahiro
itagaki.takahiro@gmail.com

New system view pg_stat_replication displays activity of wal sender processes.

Itagaki Takahiro and Simon Riggs.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=a755ea33ae3d772977fa083a8614bb9d4cc36e5a

Modified Files
--------------
src/backend/catalog/system_views.sql | 15 +++++++
src/backend/replication/walsender.c | 74 ++++++++++++++++++++++++++++++++++
src/include/catalog/pg_proc.h | 2 +
src/include/replication/walsender.h | 2 +
src/test/regress/expected/rules.out | 3 +-
5 files changed, 95 insertions(+), 1 deletions(-)

#2Magnus Hagander
magnus@hagander.net
In reply to: Itagaki Takahiro (#1)
Re: pgsql: New system view pg_stat_replication displays activity of wal sen

On Fri, Jan 7, 2011 at 12:42, Itagaki Takahiro
<itagaki.takahiro@gmail.com> wrote:

New system view pg_stat_replication displays activity of wal sender processes.

Umm. SGML updates?

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

#3Itagaki Takahiro
itagaki.takahiro@gmail.com
In reply to: Magnus Hagander (#2)
1 attachment(s)
Re: [COMMITTERS] pgsql: New system view pg_stat_replication displays activity of wal sen

On Fri, Jan 7, 2011 at 21:49, Magnus Hagander <magnus@hagander.net> wrote:

New system view pg_stat_replication displays activity of wal sender processes.

Umm. SGML updates?

Oops, sorry. Additional documentation patch attached.
Could you proofread the text?

--
Itagaki Takahiro

Attachments:

pg_stat_replication_docs.patchapplication/octet-stream; name=pg_stat_replication_docs.patchDownload
diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml
index b1ec461..a50e1f6 100644
*** a/doc/src/sgml/high-availability.sgml
--- b/doc/src/sgml/high-availability.sgml
*************** primary_conninfo = 'host=192.168.1.50 po
*** 865,870 ****
--- 865,879 ----
       process status of the WAL receiver process, displayed using the
       <command>ps</> command (see <xref linkend="monitoring-ps"> for details).
      </para>
+     <para>
+      You can retrieve a list of WAL sender processes via <link linkend="monitoring-stats-views-table">
+      <literal>pg_stat_replication</></link> view. Large differences between
+      <function>pg_current_xlog_location</> and <literal>sent_location</> field
+      might show the master server is under high load. On the other hand,
+      differences between <literal>sent_location</> and 
+      <function>pg_last_xlog_receive_location</> on the standby might show the
+      standby is under high load or network delay.
+     </para>
     </sect3>
  
    </sect2>
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 739b8a2..b935107 100644
*** a/doc/src/sgml/monitoring.sgml
--- b/doc/src/sgml/monitoring.sgml
*************** postgres: <replaceable>user</> <replacea
*** 272,277 ****
--- 272,285 ----
       </row>
  
       <row>
+       <entry><structname>pg_stat_replication</><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
+       <entry>One row per WAL sender process, showing process <acronym>ID</>,
+       user OID, user name, application name, client's address and port number,
+       times at which the server process, and transaction log location.
+      </entry>
+      </row>
+ 
+      <row>
        <entry><structname>pg_stat_database</><indexterm><primary>pg_stat_database</primary></indexterm></entry>
        <entry>One row per database, showing database OID, database name,
        number of active server processes connected to that database,
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#2)
Re: pgsql: New system view pg_stat_replication displays activity of wal sen

Magnus Hagander <magnus@hagander.net> writes:

On Fri, Jan 7, 2011 at 12:42, Itagaki Takahiro
<itagaki.takahiro@gmail.com> wrote:

New system view pg_stat_replication displays activity of wal sender processes.

Umm. SGML updates?

Not to mention a catversion bump?

regards, tom lane

#5Robert Haas
robertmhaas@gmail.com
In reply to: Itagaki Takahiro (#3)
Re: Re: [COMMITTERS] pgsql: New system view pg_stat_replication displays activity of wal sen

On Fri, Jan 7, 2011 at 8:47 AM, Itagaki Takahiro
<itagaki.takahiro@gmail.com> wrote:

On Fri, Jan 7, 2011 at 21:49, Magnus Hagander <magnus@hagander.net> wrote:

New system view pg_stat_replication displays activity of wal sender processes.

Umm. SGML updates?

Oops, sorry. Additional documentation patch attached.
Could you proofread the text?

Done, edited, committed, along with the catversion bump (as noted by Tom).

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#6Itagaki Takahiro
itagaki.takahiro@gmail.com
In reply to: Robert Haas (#5)
Re: Re: [COMMITTERS] pgsql: New system view pg_stat_replication displays activity of wal sen

On Sat, Jan 8, 2011 at 01:09, Robert Haas <robertmhaas@gmail.com> wrote:

Oops, sorry. Additional documentation patch attached.
Could you proofread the text?

Done, edited, committed, along with the catversion bump (as noted by Tom).

Thanks a lot!

--
Itagaki Takahiro