Doc: add more explanation to follow_master_command.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 5 Mar 2019 15:13:24 +0000 (00:13 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 5 Mar 2019 15:13:24 +0000 (00:13 +0900)
Add description how follow_master_command is executed etc.

doc.ja/src/sgml/failover.sgml

index c465a32fb15df6fa52cb54d661d1b9df594a7bfd..5ab9d701222923847f725dd7aa0093baf0996383 100644 (file)
@@ -355,13 +355,50 @@ failover_commandの完全な例が<xref linkend="example-cluster">にありま
 
         <para>
 <!--
-          Specifies a user command to run after failover on the primary node failover.
-                 This works only in Master Replication mode with streaming replication.
-          <productname>Pgpool-II</productname> replaces the following special characters
-          with the backend specific information before excuting the command.
+          Specifies a user command to run after failover on the
+         primary node failover. In case of standby node failover, the
+         command will not be executed. This command also runs if a
+         node promote request is issued by
+         <xref linkend="PCP-PROMOTE-NODE"> command. This works only
+         in Master Replication mode with streaming replication.
 -->
 プライマリノードのフェイルオーバー後に実行するユーザコマンドを指定します。
+スタンバイがフェイルオーバーした際にはこのコマンドは実行されません。
+このコマンドは、<xref linkend="PCP-PROMOTE-NODE">コマンドによってノードを昇格する要求があった場合にも起動されます。
 この機能は、マスタースレーブモードでストリーミングレプリケーション構成の場合のみ有効です。
+        </para>
+
+       <para>
+<!--
+         Since the command is executed within a child process forked
+         off by <productname>Pgpool-II</productname> after failover
+         is completed, execution of follow master command does not
+         block the service
+         of <productname>Pgpool-II</productname>. Here is a pseud
+         code to illustrate how the command is executed:
+-->
+         <programlisting>
+for each backend node
+{
+    if (the node is not the new primary)
+        set down node status to shared memory status
+        memorize that folllow master command is needed to execute
+}
+if (we need to executed follow master command)
+    fork a child process
+    (within the child process)
+
+    for each backend node
+        if (the node status in shared memory is down)
+            execute follow master command
+         </programlisting>
+       </para>
+
+       <para>
+<!--
+          <productname>Pgpool-II</productname> replaces the following special characters
+          with the backend specific information before excuting the command.
+-->
 <productname>Pgpool-II</productname>はコマンド実行の前に、以下の特殊文字をバックエンドの具体的な情報に置き換えます。
 
         </para>