[pgpool-hackers: 3746] Re: Proposal: Simplify WATCHDOG host configurations.

Tatsuo Ishii ishii at sraoss.co.jp
Tue Jul 28 14:13:14 JST 2020


Hi Peng,

Thank you for the patch (that must be a hard work). I have applied the
patch to the master branch head and here are some comments:

1. The patch should not include Makefile.in. In the development stage
each developer uses their own environment, thus generated files by
autoconf may vary. This prevented me from applying the patch and I had
to remove Makefile.in patch part.

2. I saw some warnings from gcc.

-------------------------------------------------------------------------------------------------------------
config/pool_config_variables.c: In function ‘SetHBDestIfFunc’:
config/pool_config_variables.c:4945:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (g_pool_config.wd_lifecheck_method != LIFECHECK_BY_HB)
     ^~
config/pool_config_variables.c:4955:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  for (i = 0; i < WD_MAX_IF_NUM; i++)
  ^~~
pool_config_variables.c: In function ‘SetHBDestIfFunc’:
pool_config_variables.c:4945:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (g_pool_config.wd_lifecheck_method != LIFECHECK_BY_HB)
     ^~
pool_config_variables.c:4955:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  for (i = 0; i < WD_MAX_IF_NUM; i++)
  ^~~
pool_config_variables.c: In function ‘SetHBDestIfFunc’:
pool_config_variables.c:4945:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (g_pool_config.wd_lifecheck_method != LIFECHECK_BY_HB)
     ^~
pool_config_variables.c:4955:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  for (i = 0; i < WD_MAX_IF_NUM; i++)
  ^~~
pool_config_variables.c: In function ‘SetHBDestIfFunc’:
pool_config_variables.c:4945:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (g_pool_config.wd_lifecheck_method != LIFECHECK_BY_HB)
     ^~
pool_config_variables.c:4955:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  for (i = 0; i < WD_MAX_IF_NUM; i++)
  ^~~
-------------------------------------------------------------------------------------------------------------

3. I confirmed that standard regression tests were all ok on my
Ubuntu18 box.

Other than the warnings above and Makefile.in issue, this patch looks
in good shape for me.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

> hello,
> 
> I have completed this patch.
> (The configuration example docs need to be updated.)
> 
> This patch can simplify WATCHDOG configurations
> by using a common configuration file for each pgpool node,
> and users just copy the configuration file to each other node without editing.
> 
> =======
> Changes
> =======
> 
> The current watchdog and heartbeat configuration parameters (for 3 pgpool nodes)
> 
>     ---- 
>     wd_hostname
>     wd_port
>     wd_heartbeat_port
>     heartbeat_destination0
>     heartbeat_destination_port0
>     heartbeat_destination1
>     heartbeat_destination_port1
>     other_pgpool_hostname0
>     other_pgpool_port0
>     other_pgpool_hostname1
>     other_pgpool_port1
>     ---- 
> 
> are changed to 
> 
>      ---- 
>      hostname0 = 'server1'
>      wd_port0 = 9000
>      pgpool_port0 = 9999
> 
>      hostname1 = 'server2'
>      wd_port1 = 9000
>      pgpool_port1 = 9999
> 
>      hostname2 = 'server3'
>      wd_port2 = 9000
>      pgpool_port2 = 9999
> 
>      heartbeat_hostname0 = 'server1'
>      heartbeat_port0 = 9694
>      heartbeat_device0 = ''
> 
>      heartbeat_hostname1 = 'server2'
>      heartbeat_port1 = 9694
>      heartbeat_device1 = ''
> 
>      heartbeat_hostname2 = 'server3'
>      heartbeat_port2 = 9694
>      heartbeat_device2 = ''
>      ---- 
> 
> You can specify multiple configurations in 
> "heartbeat_hostname" and "heartbeat_device" by separating 
> them using semicolon (;). 
> 
> And user needs to specify local pgpool node id in a pgpool_node_id file 
> which is created in the direcroty of pgpool.conf.
> 
> For example:
> 
> (pgpool node 0)
> $ cat <directory path of pgpool.conf>/pgpool_node_id
> 0
> 
> (pgpool node 1)
> $ cat <directory path of pgpool.conf>/pgpool_node_id
> 1
> 
> (pgpool node 2)
> $ cat <directory path of pgpool.conf>/pgpool_node_id
> 2
> 
> 
> Any feedback about this patch?
> 
> 
> On Thu, 25 Jun 2020 11:17:13 +0900 (JST)
> Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
> 
>> > Ishii-san, Usama,
>> > 
>> > Thank you for your advice.
>> > I have some questions about heartbeat related parameters.
>> > 
>> > I would like to change the watchdog related parameters as follow:
>> > 
>> > ----------------------
>> > wd_hostname0 =                  
>> > pgpool_port0 = 
>> > wd_port0 = 
>> > 
>> > wd_hostname1 =                  
>> > pgpool_port1 = 
>> > wd_port1 =
>> > .
>> > .
>> > .
>> > 
>> > heartbeat_hostname0 =
>> > heartbeat_port0 =
>> > heartbeat_device0 =
>> > 
>> > heartbeat_hostname1 =
>> > heartbeat_port1 =
>> > heartbeat_device1 =
>> > ----------------------
>> > 
>> > However, during the implementation, I noticed more than one network interface
>> > can be specified to send/receive heartbeat signal in Pgpool-II.
>> > 
>> > Because only one "wd_heartbeat_port" can be specified,
>> > "heartbeat_destination_portX" should be specified with the same port number?
>> > 
>> > 
>> > For example: 3 pgpool node, heartbeat with 2 NIC
>> > 
>> > Should we configure heartbeat paramaters as below?
>> > 
>> > ---------------
>> > wd_heartbeat_port = 9694
>> > 
>> > heartbeat_destination0 = "192.168.37.102"
>> > heartbeat_destination1 = '192.168.54.102'
>> > heartbeat_destination_port0 = 9694 
>> > heartbeat_destination_port1 = 9694 
>> > heartbeat_device0 = 'eth0'
>> > heartbeat_device1 = 'eth1'
>> > 
>> > heartbeat_destination2 = '192.168.37.103'
>> > heartbeat_destination3 = '192.168.54.103'
>> > heartbeat_destination_port2 = 9694 
>> > heartbeat_destination_port3 = 9694 
>> > heartbeat_device2 = 'eth0'
>> > heartbeat_device3 = 'eth1'
>> > ---------------
>> > 
>> > 
>> > If above is correct, I would like to design the heartbeat paramaters as below:
>> > If it is the own node settings, "heartbeat_hostname" and "heartbeat_device" will be ignored.
>> > 
>> > ---------------
>> > heartbeat_hostname0 = '192.168.37.101:192.168.54.101'
>> > heartbeat_port0 = 9694
>> > heartbeat_device0 = 'eth0:eth1'
>> > 
>> > heartbeat_hostname1 = '192.168.37.102:192.168.54.102'
>> > heartbeat_port1 = 9694
>> > heartbeat_device1 = 'eth0:eth1'
>> > 
>> > heartbeat_hostname2 = '192.168.37.103:192.168.54.103'
>> > heartbeat_port2 = 9694
>> > heartbeat_device2 = 'eth0:eth1'
>> > ---------------
>> > 
>> > What do you think?
>> 
>> Above looks good to me.
>> 
>> BTW, if the IP addresses are on the same subnet, it is not enough to
>> specify heartbeat_device. You also need to tweak Linux kernel
>> parameters
>> (/proc/sys/net/ipv4/conf/***/{arp_announce,arp_ignore). Maybe we
>> should note this in the manual.
>> 
>> I have learned this from following blog (in Japanese).
>> 
>> http://www.nminoru.jp/~nminoru/diary/2014/02.html#20140203p1
>> 
>> Best regards,
>> --
>> Tatsuo Ishii
>> SRA OSS, Inc. Japan
>> English: http://www.sraoss.co.jp/index_en.php
>> Japanese:http://www.sraoss.co.jp
> 
> 
> -- 
> Bo Peng <pengbo at sraoss.co.jp>
> SRA OSS, Inc. Japan


More information about the pgpool-hackers mailing list