[pgpool-general: 5308] Re: About failover execution and master node detection

Tatsuo Ishii ishii at sraoss.co.jp
Wed Feb 8 08:10:22 JST 2017


%m is the new master node chosen by Pgpool-II. It is the node being
assigned the youngest (smallest) node id which is alive.

For example if you have 3 nodes, namely node 0, 1, 2. Suppose node 1
the primary and all of them are healthy (no down node). If node 1
fails, failover_command is called with %m = 0.

If node 0 is down, %m would be 2.

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

> Thanks for your answer.
> 
> In the failover_command configuration parameter, %m is the new master
> selected by pgpool. With 2 standby servers, what node is selected as master?
> 
> failover_command = ''
>                                    # Executes this command at failover
>                                    # Special values:
>                                    #   %d = node id
>                                    #   %h = host name
>                                    #   %p = port number
>                                    #   %D = database cluster path
>                                    #   %m = new master node id
>                                    #   %H = hostname of the new master node
>                                    #   %M = old master node id
>                                    #   %P = old primary node id
> 								   #   %r =
> new master port number
> 								   #   %R =
> new master database cluster path
>                                    #   %% = '%' carácter
> 
> Regards.
> 
> -----Mensaje original-----
> De: Tatsuo Ishii [mailto:ishii at sraoss.co.jp] 
> Enviado el: martes, 7 de febrero de 2017 04:51 a. m.
> Para: lazaro3487 at gmail.com
> CC: pgpool-general at pgpool.net
> Asunto: Re: [pgpool-general: 5302] About failover execution and master node
> detection
> 
>> I am Reading the pgpool documentation and i have a doubt related to 
>> failover and selecting a new master node.
>> 
>>  
>> 
>> I want to create a cluster with more than 2 nodes for instance 3 
>> nodes. The question is when the backend shuts down, the new primary 
>> selected by pgpool and sended to the failover command is the closest 
>> node to previous master, in terms of replication delay?
> 
> Probably you are misunderstanding. Pgpool-II does *not* automatically choose
> new primary. It's totally up to you how to select the new primary node in
> the failover command script. In other word, the logic to choose the new
> primary node should be explicitly coded in the failover command script.
> 
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
> 


More information about the pgpool-general mailing list