doc: Documentation update for dynamic cluster membership feature
authorMuhammad Usama <m.usama@highgo.ca>
Sun, 7 Nov 2021 11:21:14 +0000 (16:21 +0500)
committerMuhammad Usama <m.usama@gmail.com>
Sun, 7 Nov 2021 11:21:50 +0000 (16:21 +0500)
doc/src/sgml/example-cluster.sgml
doc/src/sgml/ref/pcp_watchdog_info.sgml
doc/src/sgml/ref/watchdog_setup.sgml
doc/src/sgml/watchdog.sgml

index 100d51bb8f93d853b25ecc625e915a6d06ad8eb5..d6cef8aacec9bf744a26b0bb09184de634cfbe7b 100644 (file)
@@ -1152,11 +1152,11 @@ node_id | hostname | port | status | lb_weight |  role   | select_cnt | load_bal
    <programlisting>
 # pcp_watchdog_info -h 192.168.137.150 -p 9898 -U pgpool
 Password:
-3 YES server1:9999 Linux server1 server1
+3 YES server1:9999 Linux server1 server1
 
-server1:9999 Linux server1 server1 9999 9000 4 LEADER  #The Pgpool-II server started first became "LEADER".
-server2:9999 Linux server2 server2 9999 9000 7 STANDBY #run as standby
-server3:9999 Linux server3 server3 9999 9000 7 STANDBY #run as standby
+server1:9999 Linux server1 server1 9999 9000 4 LEADER 0 MEMBER #The Pgpool-II server started first became "LEADER".
+server2:9999 Linux server2 server2 9999 9000 7 STANDBY 0 MEMBER #run as standby
+server3:9999 Linux server3 server3 9999 9000 7 STANDBY 0 MEMBER #run as standby
    </programlisting>
    <para>
     Stop active server <literal>server1</literal>, then <literal>server2</literal> or 
@@ -1169,11 +1169,11 @@ server3:9999 Linux server3 server3 9999 9000 7 STANDBY #run as standby
 
 # pcp_watchdog_info -p 9898 -h 192.168.137.150 -U pgpool
 Password:
-3 YES server2:9999 Linux server2 server2
+3 YES server2:9999 Linux server2 server2
 
-server2:9999 Linux server2 server2 9999 9000 4 LEADER     #server2 is promoted to LEADER
-server1:9999 Linux server1 server1 9999 9000 10 SHUTDOWN  #server1 is stopped
-server3:9999 Linux server3 server3 9999 9000 7 STANDBY    #server3 runs as STANDBY
+server2:9999 Linux server2 server2 9999 9000 4 LEADER 0 MEMBER    #server2 is promoted to LEADER
+server1:9999 Linux server1 server1 9999 9000 10 SHUTDOWN 0 MEMBER #server1 is stopped
+server3:9999 Linux server3 server3 9999 9000 7 STANDBY 0 MEMBER   #server3 runs as STANDBY
    </programlisting>
    <para>
     Start <productname>Pgpool-II</productname> (<literal>server1</literal>) which we have stopped again,
@@ -1184,11 +1184,11 @@ server3:9999 Linux server3 server3 9999 9000 7 STANDBY    #server3 runs as STAND
 
 [server1]# pcp_watchdog_info -p 9898 -h 192.168.137.150 -U pgpool
 Password: 
-3 YES server2:9999 Linux server2 server2
+3 YES server2:9999 Linux server2 server2
 
-server2:9999 Linux server2 server2 9999 9000 4 LEADER
-server1:9999 Linux server1 server1 9999 9000 7 STANDBY
-server3:9999 Linux server3 server3 9999 9000 7 STANDBY
+server2:9999 Linux server2 server2 9999 9000 4 LEADER 0 MEMBER
+server1:9999 Linux server1 server1 9999 9000 7 STANDBY 0 MEMBER
+server3:9999 Linux server3 server3 9999 9000 7 STANDBY 0 MEMBER
    </programlisting>
   </sect3>
 
index df75edf21bbe7fc4cac08b66dde6e20f9c6a9d5d..90ffb3dbe542793d849baf85c7bc35eff72f565f 100644 (file)
@@ -76,11 +76,11 @@ Pgpool-II documentation
    <programlisting>
     $ pcp_watchdog_info -h localhost -U postgres
 
-    3 NO Linux_host1.localdomain_9991 host1
+    3 NO Linux_host1.localdomain_9991 host1
 
-    Linux_host1.localdomain_9991 host1 9991 9001 7 STANDBY
-    Linux_host2.localdomain_9992 host2 9992 9002 4 LEADER
-    Linux_host3.localdomain_9993 host3 9993 9003 7 STANDBY
+    Linux_host1.localdomain_9991 host1 9991 9001 7 STANDBY 0 MEMBER
+    Linux_host2.localdomain_9992 host2 9992 9002 4 LEADER 0 MEMBER
+    Linux_host3.localdomain_9993 host3 9993 9003 7 STANDBY 0 MEMBER
    </programlisting>
   </para>
   <para>
@@ -89,9 +89,10 @@ Pgpool-II documentation
     The first output line describes the watchdog cluster information:
 
     1. Total watchdog nodes in the cluster
-    2. Is VIP is up on current node?
-    3. Leader node name
-    4. Leader node host
+    2. Total watchdog nodes in the cluster with active membership
+    3. Is VIP is up on current node?
+    4. Leader node name
+    5. Leader node host
    </literallayout>
    <literallayout class="monospaced">
     Next is the list of watchdog nodes:
@@ -102,6 +103,8 @@ Pgpool-II documentation
     4. watchdog port
     5. current node state
     6. current node state name
+    7. current cluster membership status
+    8. current cluster membership status name
    </literallayout>
   </para>
   <para>
@@ -111,41 +114,46 @@ Pgpool-II documentation
    $ pcp_watchdog_info -h localhost -v -U postgres
 
    Watchdog Cluster Information
-   Total Nodes          : 3
-   Remote Nodes         : 2
-   Quorum state         : QUORUM EXIST
-   Alive Remote Nodes   : 2
-   VIP up on local node : NO
-   Leader Node Name     : Linux_host2.localdomain_9992
-   Leader Host Name     : localhost
+   Total Nodes              : 3
+   Remote Nodes             : 2
+   Member Remote Nodes      : 2
+   Nodes required for quorum: 2
+   Quorum state             : QUORUM EXIST
+   Alive Remote Nodes       : 2
+   VIP up on local node     : NO
+   Leader Node Name         : Linux_host2.localdomain_9992
+   Leader Host Name         : localhost
 
    Watchdog Node Information
-   Node Name      : Linux_host1.localdomain_9991
-   Host Name      : host1
-   Delegate IP    : 192.168.1.10
-   Pgpool port    : 9991
-   Watchdog port  : 9001
-   Node priority  : 1
-   Status         : 7
-   Status Name    : STANDBY
-
-   Node Name      : Linux_host2.localdomain_9992
-   Host Name      : host2
-   Delegate IP    : 192.168.1.10
-   Pgpool port    : 9992
-   Watchdog port  : 9002
-   Node priority  : 1
-   Status         : 4
-   Status Name    : LEADER
-
-   Node Name      : Linux_host3.localdomain_9993
-   Host Name      : host3
-   Delegate IP    : 192.168.1.10
-   Pgpool port    : 9993
-   Watchdog port  : 9003
-   Node priority  : 1
-   Status         : 7
-   Status Name    : STANDBY
+   Node Name         : Linux_host1.localdomain_9991
+   Host Name         : host1
+   Delegate IP       : 192.168.1.10
+   Pgpool port       : 9991
+   Watchdog port     : 9001
+   Node priority     : 1
+   Status            : 7
+   Status Name       : STANDBY
+   Membership Status : MEMBER
+
+   Node Name         : Linux_host2.localdomain_9992
+   Host Name         : host2
+   Delegate IP       : 192.168.1.10
+   Pgpool port       : 9992
+   Watchdog port     : 9002
+   Node priority     : 1
+   Status            : 4
+   Status Name       : LEADER
+   Membership Status : MEMBER
+
+   Node Name         : Linux_host3.localdomain_9993
+   Host Name         : host3
+   Delegate IP       : 192.168.1.10
+   Pgpool port       : 9993
+   Watchdog port     : 9003
+   Node priority     : 1
+   Status            : 7
+   Status Name       : STANDBY
+   Membership Status : MEMBER
   </programlisting>
  </refsect1>
 
index e321f85dc7e62d540fc65849e7a1b2ec3c6193ba..18f27958b19238f8483a76b1db229d03c92a37d2 100644 (file)
@@ -383,41 +383,46 @@ Pgpool-II documentation
     $ pcp_watchdog_info -p 50001 -v
     Password:
     Watchdog Cluster Information
-    Total Nodes          : 3
-    Remote Nodes         : 2
-    Quorum state         : QUORUM EXIST
-    Alive Remote Nodes   : 2
-    VIP up on local node : NO
-    Leader Node Name     : Linux_tishii-CF-SX3HE4BP_50004
-    Leader Host Name     : localhost
+    Total Nodes              : 3
+    Remote Nodes             : 2
+       Member Remote Nodes      : 2
+       Nodes required for quorum: 2
+    Quorum state             : QUORUM EXIST
+    Alive Remote Nodes       : 2
+    VIP up on local node     : NO
+    Leader Node Name         : Linux_tishii-CF-SX3HE4BP_50004
+    Leader Host Name         : localhost
 
     Watchdog Node Information
-    Node Name      : Linux_tishii-CF-SX3HE4BP_50000
-    Host Name      : localhost
-    Delegate IP    : Not_Set
-    Pgpool port    : 50000
-    Watchdog port  : 50002
-    Node priority  : 1
-    Status         : 7
-    Status Name    : STANDBY
-
-    Node Name      : Linux_tishii-CF-SX3HE4BP_50004
-    Host Name      : localhost
-    Delegate IP    : Not_Set
-    Pgpool port    : 50004
-    Watchdog port  : 50006
-    Node priority  : 1
-    Status         : 4
-    Status Name    : LEADER
-
-    Node Name      : Linux_tishii-CF-SX3HE4BP_50008
-    Host Name      : localhost
-    Delegate IP    : Not_Set
-    Pgpool port    : 50008
-    Watchdog port  : 50010
-    Node priority  : 1
-    Status         : 7
-    Status Name    : STANDBY
+    Node Name         : Linux_tishii-CF-SX3HE4BP_50000
+    Host Name         : localhost
+    Delegate IP       : Not_Set
+    Pgpool port       : 50000
+    Watchdog port     : 50002
+    Node priority     : 1
+    Status            : 7
+    Status Name       : STANDBY
+       Membership Status : MEMBER
+
+    Node Name         : Linux_tishii-CF-SX3HE4BP_50004
+    Host Name         : localhost
+    Delegate IP       : Not_Set
+    Pgpool port       : 50004
+    Watchdog port     : 50006
+    Node priority     : 1
+    Status            : 4
+    Status Name       : LEADER
+       Membership Status : MEMBER
+
+    Node Name         : Linux_tishii-CF-SX3HE4BP_50008
+    Host Name         : localhost
+    Delegate IP       : Not_Set
+    Pgpool port       : 50008
+    Watchdog port     : 50010
+    Node priority     : 1
+    Status            : 7
+    Status Name       : STANDBY
+       Membership Status : MEMBER
 
    </screen>
   </para>
index 239a2d6a0cc62f56b07bed362628fa7e644c47af..c90473021aced0a6dd3ecfb37f1c80cd13634120 100644 (file)
@@ -780,6 +780,116 @@ pgpool_port2 = 9999
   </variablelist>
  </sect2>
 
+ <sect2 id="config-watchdog-cluster-membership">
+  <title>Controlling the watchdog cluster membership </title>
+
+  <para>
+       By default the watchdog cluster consists of all watchdog nodes
+       that are defined in the <filename>pgpool.conf</filename> file
+       irrespective of the current state of the node. Whether the node
+       is <literal>LOST</literal>, <literal>SHUTDOWN</literal>
+       or never started, the node is considered as the member of the
+       watchdog cluster definition as long as it is configured in the
+       configuration file.
+       All the majority rule computations for identifying the existence
+       of a quorum and resolving the consensus are made based on the
+       number of watchdog nodes that makes up the watchdog cluster.
+  </para>
+
+  <para>
+       <productname>Pgpool-II</productname> <emphasis>V4.3</emphasis> enables
+       dynamic cluster definition by introducing the concept of
+       <emphasis>Member</emphasis> and <emphasis>Nonmember</emphasis>.
+       If the node's membership gets revoked from the watchdog cluster,
+       then the cluster re-calibrate itself dynamically to adjust all
+       subsequent majority rule computations.
+       </para>
+       <para>
+       All majority rule computations are done based on the number of
+       member watchdog nodes instead of total number of configured nodes.
+  </para>
+
+  <para>
+       For example: In a five node cluster (<filename>pgpool.conf</filename> has five
+       watchdog nodes defined) at-least three nodes need to be alive to make the quorum.
+       With the dynamic cluster membership mechanism the cluster can re-adjust
+       itself to only count the <emphasis>MEMBER</emphasis> nodes
+       (Member node doesn't necessarily need to be alive).
+       That means effectively a single alive node
+       can also fulfill the quorum requirements (depending on the membership criteria settings)
+       if at some point in time the cluster only has one or two member nodes.
+  </para>
+
+  <para>
+  These settings configures when the node is marked as Nonmember.
+  Leaving all these settings to default values retains the
+  pre <emphasis>V4.3</emphasis> behaviour.
+  </para>
+
+  <variablelist>
+
+   <varlistentry id="guc-wd-remove-shutdown-nodes" xreflabel="wd_remove_shutdown_nodes">
+    <term><varname>wd_remove_shutdown_nodes</varname> (<type>boolean</type>)
+     <indexterm>
+      <primary><varname>wd_remove_shutdown_nodes</varname> configuration parameter</primary>
+     </indexterm>
+    </term>
+    <listitem>
+     <para>
+        When enabled, the <literal>SHUTDOWN</literal> nodes are immediately marked as Nonmember
+        and removed from the cluster. If the previously shutdown node starts again,
+        it gets added to cluster automatically.
+     </para>
+        <para> Default is off. </para>
+       </listitem>
+   </varlistentry>
+
+
+   <varlistentry id="guc-wd-lost-node-removal-timeout" xreflabel="wd_lost_node_removal_timeout">
+    <term><varname>wd_lost_node_removal_timeout</varname> (<type>integer</type>)
+     <indexterm>
+      <primary><varname>wd_lost_node_removal_timeout</varname> configuration parameter</primary>
+     </indexterm>
+    </term>
+    <listitem>
+     <para>
+      Timeout in seconds to mark the <literal>LOST</literal> watchdog node as
+         Nonmember and remove from the cluster.
+         When LOST node re-connects to the cluster, its cluster membership is restored.
+     </para>
+        <para>
+        Setting the timeout to <literal>0</literal> disables the removal
+        of LOST nodes from cluster.
+        </para>
+        <para> Default is 0. </para>
+
+       </listitem>
+   </varlistentry>
+
+   <varlistentry id="guc-wd-no-show-node-removal-timeout" xreflabel="wd_no_show_node_removal_timeout">
+    <term><varname>wd_no_show_node_removal_timeout</varname> (<type>integer</type>)
+     <indexterm>
+      <primary><varname>wd_no_show_node_removal_timeout</varname> configuration parameter</primary>
+     </indexterm>
+    </term>
+    <listitem>
+     <para>
+      Timeout in seconds to mark the node as Nonmember if it doesn't show up
+         at cluster initialisation. Nonmember node becomes the cluster Member as
+         soon as it starts up and connects to the cluster.
+        </para>
+        <para>
+        Setting the timeout to <literal>0</literal> disables the removal
+        of <literal>NO-SHOW</literal> nodes from cluster.
+        </para>
+        <para> Default is 0. </para>
+
+       </listitem>
+  </varlistentry>
+
+  </variablelist>
+ </sect2>
+
  <sect2 id="config-watchdog-lifecheck">
   <title>Life checking <productname>Pgpool-II</productname> </title>