1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Improve documentation about pg_stat_replication view.

Add the descriptions of possible values in "state" and "sync_state" columns
of pg_stat_replication view.

Author: Michael Paquier, slightly modified by me
Discussion: <CAB7nPqT7APWrvPFZrcjKEHoq4=g3z2ErxtTdojSf+sDALzuemA@mail.gmail.com>
This commit is contained in:
Fujii Masao
2016-12-06 17:09:10 +09:00
parent 3ebf2b4545
commit dfe530a092
2 changed files with 55 additions and 2 deletions

View File

@ -1161,6 +1161,10 @@ synchronous_standby_names = '2 (s1, s2, s3)'
<literal>s2</> fails. <literal>s4</> is an asynchronous standby since <literal>s2</> fails. <literal>s4</> is an asynchronous standby since
its name is not in the list. its name is not in the list.
</para> </para>
<para>
The synchronous states of standby servers can be viewed using
the <structname>pg_stat_replication</structname> view.
</para>
</sect3> </sect3>
<sect3 id="synchronous-replication-performance"> <sect3 id="synchronous-replication-performance">
@ -1235,6 +1239,8 @@ synchronous_standby_names = '2 (s1, s2, s3)'
will increase according to the length of time the standby has been down. will increase according to the length of time the standby has been down.
The standby is only able to become a synchronous standby The standby is only able to become a synchronous standby
once it has reached <literal>streaming</> state. once it has reached <literal>streaming</> state.
This state can be viewed using
the <structname>pg_stat_replication</structname> view.
</para> </para>
<para> <para>

View File

@ -1357,7 +1357,33 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row> <row>
<entry><structfield>state</></entry> <entry><structfield>state</></entry>
<entry><type>text</></entry> <entry><type>text</></entry>
<entry>Current WAL sender state</entry> <entry>Current WAL sender state.
Possible values are:
<itemizedlist>
<listitem>
<para>
<literal>startup</>: This WAL sender is starting up.
</para>
</listitem>
<listitem>
<para>
<literal>catchup</>: This WAL sender's connected standby is
catching up with the primary.
</para>
</listitem>
<listitem>
<para>
<literal>streaming</>: This WAL sender is streaming changes
after its connected standby server has caught up with the primary.
</para>
</listitem>
<listitem>
<para>
<literal>backup</>: This WAL sender is sending a backup.
</para>
</listitem>
</itemizedlist>
</entry>
</row> </row>
<row> <row>
<entry><structfield>sent_location</></entry> <entry><structfield>sent_location</></entry>
@ -1391,7 +1417,28 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
<row> <row>
<entry><structfield>sync_state</></entry> <entry><structfield>sync_state</></entry>
<entry><type>text</></entry> <entry><type>text</></entry>
<entry>Synchronous state of this standby server</entry> <entry>Synchronous state of this standby server.
Possible values are:
<itemizedlist>
<listitem>
<para>
<literal>async</>: This standby server is asynchronous.
</para>
</listitem>
<listitem>
<para>
<literal>potential</>: This standby server is now asynchronous,
but can potentially become synchronous if one of current
synchronous ones fails.
</para>
</listitem>
<listitem>
<para>
<literal>sync</>: This standby server is synchronous.
</para>
</listitem>
</itemizedlist>
</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>