<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 29, 2020 at 1:42 PM Bo Peng &lt;<a href="mailto:pengbo@sraoss.co.jp">pengbo@sraoss.co.jp</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Ishii-san,<br>
<br>
Thank you for your comments.<br>
I have fixed warnings and removed Makefile.in.<br>
Modified patch is attached.<br>
<br>
Usama,<br>
<br>
Do you have any comments?<br></blockquote><div><br></div><div>First of all thanks for the good work. I think this patch will drastically improve the watchdog setup experience. </div><div>Overall the patch looks good while I have a couple of comments that can also be taken care</div><div>of as a separate patch after committing this one.</div><div><br></div><div>-- You have rightly removed wd_port key from config JSON  (in get_pool_config_from_json() and get_pool_config_json() functions)<br>So I think this will cause incompatibility with the older versions. So we may need to bump the<br>WD_MESSAGE_DATA_VERSION_MINOR version.</div><div><br>-- currently, watchdog uses the <font face="monospace">WatchdogNode-&gt;private_id</font> to identify each watchdog<br></div></div><div class="gmail_quote">node locally while <font face="monospace">private_id</font> of local node is always set to 0.</div><div class="gmail_quote">And now with this patch, the node number for each watchdog node can be<br>consistent across the cluster so we can make this private_id go away and use pgpool_node_id</div><div class="gmail_quote">as a cluster-wide unique id for each node.<br>For that, I think we can also include pgpool_node_id in the WD_ADD_NODE_MESSAGE</div><div class="gmail_quote">message and upon receiving WD_ADD_NODE_MESSAGE watchdog must also</div><div class="gmail_quote">verify that multiple pgpool-II nodes should not be using the same  pgpool_node_id.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Thanks</div><div class="gmail_quote">Best regards</div><div class="gmail_quote">Muhammad Usama</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
On Tue, 28 Jul 2020 14:13:14 +0900 (JST)<br>
Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt; wrote:<br>
<br>
&gt; Hi Peng,<br>
&gt; <br>
&gt; Thank you for the patch (that must be a hard work). I have applied the<br>
&gt; patch to the master branch head and here are some comments:<br>
&gt; <br>
&gt; 1. The patch should not include Makefile.in. In the development stage<br>
&gt; each developer uses their own environment, thus generated files by<br>
&gt; autoconf may vary. This prevented me from applying the patch and I had<br>
&gt; to remove Makefile.in patch part.<br>
&gt; <br>
&gt; 2. I saw some warnings from gcc.<br>
&gt; <br>
&gt; -------------------------------------------------------------------------------------------------------------<br>
&gt; config/pool_config_variables.c: In function ‘SetHBDestIfFunc’:<br>
&gt; config/pool_config_variables.c:4945:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]<br>
&gt;      if (g_pool_config.wd_lifecheck_method != LIFECHECK_BY_HB)<br>
&gt;      ^~<br>
&gt; config/pool_config_variables.c:4955:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’<br>
&gt;   for (i = 0; i &lt; WD_MAX_IF_NUM; i++)<br>
&gt;   ^~~<br>
&gt; pool_config_variables.c: In function ‘SetHBDestIfFunc’:<br>
&gt; pool_config_variables.c:4945:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]<br>
&gt;      if (g_pool_config.wd_lifecheck_method != LIFECHECK_BY_HB)<br>
&gt;      ^~<br>
&gt; pool_config_variables.c:4955:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’<br>
&gt;   for (i = 0; i &lt; WD_MAX_IF_NUM; i++)<br>
&gt;   ^~~<br>
&gt; pool_config_variables.c: In function ‘SetHBDestIfFunc’:<br>
&gt; pool_config_variables.c:4945:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]<br>
&gt;      if (g_pool_config.wd_lifecheck_method != LIFECHECK_BY_HB)<br>
&gt;      ^~<br>
&gt; pool_config_variables.c:4955:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’<br>
&gt;   for (i = 0; i &lt; WD_MAX_IF_NUM; i++)<br>
&gt;   ^~~<br>
&gt; pool_config_variables.c: In function ‘SetHBDestIfFunc’:<br>
&gt; pool_config_variables.c:4945:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]<br>
&gt;      if (g_pool_config.wd_lifecheck_method != LIFECHECK_BY_HB)<br>
&gt;      ^~<br>
&gt; pool_config_variables.c:4955:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’<br>
&gt;   for (i = 0; i &lt; WD_MAX_IF_NUM; i++)<br>
&gt;   ^~~<br>
&gt; -------------------------------------------------------------------------------------------------------------<br>
&gt; <br>
&gt; 3. I confirmed that standard regression tests were all ok on my<br>
&gt; Ubuntu18 box.<br>
&gt; <br>
&gt; Other than the warnings above and Makefile.in issue, this patch looks<br>
&gt; in good shape for me.<br>
&gt; <br>
&gt; Best regards,<br>
&gt; --<br>
&gt; Tatsuo Ishii<br>
&gt; SRA OSS, Inc. Japan<br>
&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
&gt; <br>
&gt; &gt; hello,<br>
&gt; &gt; <br>
&gt; &gt; I have completed this patch.<br>
&gt; &gt; (The configuration example docs need to be updated.)<br>
&gt; &gt; <br>
&gt; &gt; This patch can simplify WATCHDOG configurations<br>
&gt; &gt; by using a common configuration file for each pgpool node,<br>
&gt; &gt; and users just copy the configuration file to each other node without editing.<br>
&gt; &gt; <br>
&gt; &gt; =======<br>
&gt; &gt; Changes<br>
&gt; &gt; =======<br>
&gt; &gt; <br>
&gt; &gt; The current watchdog and heartbeat configuration parameters (for 3 pgpool nodes)<br>
&gt; &gt; <br>
&gt; &gt;     ---- <br>
&gt; &gt;     wd_hostname<br>
&gt; &gt;     wd_port<br>
&gt; &gt;     wd_heartbeat_port<br>
&gt; &gt;     heartbeat_destination0<br>
&gt; &gt;     heartbeat_destination_port0<br>
&gt; &gt;     heartbeat_destination1<br>
&gt; &gt;     heartbeat_destination_port1<br>
&gt; &gt;     other_pgpool_hostname0<br>
&gt; &gt;     other_pgpool_port0<br>
&gt; &gt;     other_pgpool_hostname1<br>
&gt; &gt;     other_pgpool_port1<br>
&gt; &gt;     ---- <br>
&gt; &gt; <br>
&gt; &gt; are changed to <br>
&gt; &gt; <br>
&gt; &gt;      ---- <br>
&gt; &gt;      hostname0 = &#39;server1&#39;<br>
&gt; &gt;      wd_port0 = 9000<br>
&gt; &gt;      pgpool_port0 = 9999<br>
&gt; &gt; <br>
&gt; &gt;      hostname1 = &#39;server2&#39;<br>
&gt; &gt;      wd_port1 = 9000<br>
&gt; &gt;      pgpool_port1 = 9999<br>
&gt; &gt; <br>
&gt; &gt;      hostname2 = &#39;server3&#39;<br>
&gt; &gt;      wd_port2 = 9000<br>
&gt; &gt;      pgpool_port2 = 9999<br>
&gt; &gt; <br>
&gt; &gt;      heartbeat_hostname0 = &#39;server1&#39;<br>
&gt; &gt;      heartbeat_port0 = 9694<br>
&gt; &gt;      heartbeat_device0 = &#39;&#39;<br>
&gt; &gt; <br>
&gt; &gt;      heartbeat_hostname1 = &#39;server2&#39;<br>
&gt; &gt;      heartbeat_port1 = 9694<br>
&gt; &gt;      heartbeat_device1 = &#39;&#39;<br>
&gt; &gt; <br>
&gt; &gt;      heartbeat_hostname2 = &#39;server3&#39;<br>
&gt; &gt;      heartbeat_port2 = 9694<br>
&gt; &gt;      heartbeat_device2 = &#39;&#39;<br>
&gt; &gt;      ---- <br>
&gt; &gt; <br>
&gt; &gt; You can specify multiple configurations in <br>
&gt; &gt; &quot;heartbeat_hostname&quot; and &quot;heartbeat_device&quot; by separating <br>
&gt; &gt; them using semicolon (;). <br>
&gt; &gt; <br>
&gt; &gt; And user needs to specify local pgpool node id in a pgpool_node_id file <br>
&gt; &gt; which is created in the direcroty of pgpool.conf.<br>
&gt; &gt; <br>
&gt; &gt; For example:<br>
&gt; &gt; <br>
&gt; &gt; (pgpool node 0)<br>
&gt; &gt; $ cat &lt;directory path of pgpool.conf&gt;/pgpool_node_id<br>
&gt; &gt; 0<br>
&gt; &gt; <br>
&gt; &gt; (pgpool node 1)<br>
&gt; &gt; $ cat &lt;directory path of pgpool.conf&gt;/pgpool_node_id<br>
&gt; &gt; 1<br>
&gt; &gt; <br>
&gt; &gt; (pgpool node 2)<br>
&gt; &gt; $ cat &lt;directory path of pgpool.conf&gt;/pgpool_node_id<br>
&gt; &gt; 2<br>
&gt; &gt; <br>
&gt; &gt; <br>
&gt; &gt; Any feedback about this patch?<br>
&gt; &gt; <br>
&gt; &gt; <br>
&gt; &gt; On Thu, 25 Jun 2020 11:17:13 +0900 (JST)<br>
&gt; &gt; Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt; wrote:<br>
&gt; &gt; <br>
&gt; &gt;&gt; &gt; Ishii-san, Usama,<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; Thank you for your advice.<br>
&gt; &gt;&gt; &gt; I have some questions about heartbeat related parameters.<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; I would like to change the watchdog related parameters as follow:<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; ----------------------<br>
&gt; &gt;&gt; &gt; wd_hostname0 =                  <br>
&gt; &gt;&gt; &gt; pgpool_port0 = <br>
&gt; &gt;&gt; &gt; wd_port0 = <br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; wd_hostname1 =                  <br>
&gt; &gt;&gt; &gt; pgpool_port1 = <br>
&gt; &gt;&gt; &gt; wd_port1 =<br>
&gt; &gt;&gt; &gt; .<br>
&gt; &gt;&gt; &gt; .<br>
&gt; &gt;&gt; &gt; .<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; heartbeat_hostname0 =<br>
&gt; &gt;&gt; &gt; heartbeat_port0 =<br>
&gt; &gt;&gt; &gt; heartbeat_device0 =<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; heartbeat_hostname1 =<br>
&gt; &gt;&gt; &gt; heartbeat_port1 =<br>
&gt; &gt;&gt; &gt; heartbeat_device1 =<br>
&gt; &gt;&gt; &gt; ----------------------<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; However, during the implementation, I noticed more than one network interface<br>
&gt; &gt;&gt; &gt; can be specified to send/receive heartbeat signal in Pgpool-II.<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; Because only one &quot;wd_heartbeat_port&quot; can be specified,<br>
&gt; &gt;&gt; &gt; &quot;heartbeat_destination_portX&quot; should be specified with the same port number?<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; For example: 3 pgpool node, heartbeat with 2 NIC<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; Should we configure heartbeat paramaters as below?<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; ---------------<br>
&gt; &gt;&gt; &gt; wd_heartbeat_port = 9694<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; heartbeat_destination0 = &quot;192.168.37.102&quot;<br>
&gt; &gt;&gt; &gt; heartbeat_destination1 = &#39;192.168.54.102&#39;<br>
&gt; &gt;&gt; &gt; heartbeat_destination_port0 = 9694 <br>
&gt; &gt;&gt; &gt; heartbeat_destination_port1 = 9694 <br>
&gt; &gt;&gt; &gt; heartbeat_device0 = &#39;eth0&#39;<br>
&gt; &gt;&gt; &gt; heartbeat_device1 = &#39;eth1&#39;<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; heartbeat_destination2 = &#39;192.168.37.103&#39;<br>
&gt; &gt;&gt; &gt; heartbeat_destination3 = &#39;192.168.54.103&#39;<br>
&gt; &gt;&gt; &gt; heartbeat_destination_port2 = 9694 <br>
&gt; &gt;&gt; &gt; heartbeat_destination_port3 = 9694 <br>
&gt; &gt;&gt; &gt; heartbeat_device2 = &#39;eth0&#39;<br>
&gt; &gt;&gt; &gt; heartbeat_device3 = &#39;eth1&#39;<br>
&gt; &gt;&gt; &gt; ---------------<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; If above is correct, I would like to design the heartbeat paramaters as below:<br>
&gt; &gt;&gt; &gt; If it is the own node settings, &quot;heartbeat_hostname&quot; and &quot;heartbeat_device&quot; will be ignored.<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; ---------------<br>
&gt; &gt;&gt; &gt; heartbeat_hostname0 = &#39;192.168.37.101:192.168.54.101&#39;<br>
&gt; &gt;&gt; &gt; heartbeat_port0 = 9694<br>
&gt; &gt;&gt; &gt; heartbeat_device0 = &#39;eth0:eth1&#39;<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; heartbeat_hostname1 = &#39;192.168.37.102:192.168.54.102&#39;<br>
&gt; &gt;&gt; &gt; heartbeat_port1 = 9694<br>
&gt; &gt;&gt; &gt; heartbeat_device1 = &#39;eth0:eth1&#39;<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; heartbeat_hostname2 = &#39;192.168.37.103:192.168.54.103&#39;<br>
&gt; &gt;&gt; &gt; heartbeat_port2 = 9694<br>
&gt; &gt;&gt; &gt; heartbeat_device2 = &#39;eth0:eth1&#39;<br>
&gt; &gt;&gt; &gt; ---------------<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; What do you think?<br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; Above looks good to me.<br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; BTW, if the IP addresses are on the same subnet, it is not enough to<br>
&gt; &gt;&gt; specify heartbeat_device. You also need to tweak Linux kernel<br>
&gt; &gt;&gt; parameters<br>
&gt; &gt;&gt; (/proc/sys/net/ipv4/conf/***/{arp_announce,arp_ignore). Maybe we<br>
&gt; &gt;&gt; should note this in the manual.<br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; I have learned this from following blog (in Japanese).<br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; <a href="http://www.nminoru.jp/~nminoru/diary/2014/02.html#20140203p1" rel="noreferrer" target="_blank">http://www.nminoru.jp/~nminoru/diary/2014/02.html#20140203p1</a><br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; Best regards,<br>
&gt; &gt;&gt; --<br>
&gt; &gt;&gt; Tatsuo Ishii<br>
&gt; &gt;&gt; SRA OSS, Inc. Japan<br>
&gt; &gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt; &gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
&gt; &gt; <br>
&gt; &gt; <br>
&gt; &gt; -- <br>
&gt; &gt; Bo Peng &lt;<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>&gt;<br>
&gt; &gt; SRA OSS, Inc. Japan<br>
<br>
<br>
-- <br>
Bo Peng &lt;<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>&gt;<br>
SRA OSS, Inc. Japan<br>
</blockquote></div></div>