[Pgpool-hackers] path to follow master after a failover

Tatsuo Ishii ishii at sraoss.co.jp
Fri Jan 28 00:28:45 UTC 2011


Thanks. I will look into the patch to understand your idea/design
rather the code itself because this has a large impact on pgpool-II's
overall design. Also we need to look at PostgreSQL 9.1 development
cycle. It may affect the design of the patch(we want to effectively
use PostgreSQL features but in the same time we don't want to break
the compatibility to existing PostgreSQL releases). So I want to take
enough time to review your patch.

In the mean time I suggest you to test your patches in other than
streaming replication mode to make sure it does not break them.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

> Sorry for the delay, here is the patch that add a new configuration
> directive 'follow_master_command'.
> 
> After each master failover only and if the directive contains a command
> line, PgPool will degenerate all desynchronized SR backend and will
> executed the command when new master is up. This allow to set a bash
> script or other program to force the reconstruction of all secondary
> servers.
> 
> A typical follow master shell script will do :
> 
>     #!/bin/sh
>     PGPOOLIP=192.168.1.10
>     PGUSER=postgres
>     PGPASS=pcp_pass_phrase
> 
>     /usr/local/pgpool/bin/pcp_recovery_node 10 $PGPOOLIP 9898 $PGUSER
>     $PGPASS $1
>     /usr/local/pgpool/bin/pcp_attach_node 10 $PGPOOLIP 9898 $PGUSER
>     $PGPASS $1
> 
> and the follow_master_command will be set like this in pgpool.conf:
> 
>     # Execute command at end of 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
>     #                  %% = '%' character
>     #
>     follow_master_command = '/home/postgres/bin/follow_master.sh %d'
> 
> This is a first try, as I only use PgPool with Pg Streaming Replication,
> I don't know if it breaks something in the other modes. But that I've
> tried to do with this path and the other one which allow promoting any
> node as master is to change the less possible the actual code. So there
> should not be any problem with other mode and if so it could be simply
> fixed. Any feedback will be appreciated.
> 
> Thanks for your help,
> 
> Regards,
> 
> -- 
> Gilles Darold
> http://dalibo.com - http://dalibo.org
> 


More information about the Pgpool-hackers mailing list