[Pgpool-hackers] Promoting any node as master with SR slaves follow

Jehan-Guillaume (ioguix) de Rorthais jgdr at dalibo.com
Mon Jan 24 13:08:11 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le 20/01/2011 20:15, Gilles Darold a écrit :
> Hi,
> 
> [...]
> 
> All this make me do some work on PgPool source code as I think it may
> handle that easily. The patch do the following:
> 
> Add a PCP command to promote any node in the pgpool line as the new
> master : pcp_promote_node
> Add a follow master configuration option to call an external command
> when the failover is over.
> 
> So that if I run :
> 
>     pcp_promote_node 10 192.168.1.11 9898 postgres postgres 3
> 
> Node 3 is promoted as master and all other nodes are degenerated.

great. +1

> When the failover is ended PgPool fork a child to execute the command
> given in the follow_master_command successively for each node
> degenerated. The follow master command is simply a call to the
> pcp_recovery_node.

IIRC, we talked a bit about that together a week or two ago.
it seems to me it would be cleaner and simpler to use the parameter
"recovery_end_command" from the postgresql recovery.conf file to send the
command follow_master_command to the pgpool service as soon as the new master is
effectively up and ready.

Using this existing mechanism from postgresql itself would avoid some new code
block in pgpool, delay, check to see if the new master is up or not, etc

> 
> I've played some time with that patch and it works pretty well for me.
> 
> Well before going further I need to know if this is something useful
> that can be applied to PgPool? I also need help for testing under other
> modes than streaming replication.
> 
> Thanks for your comments.
> 
> Best regards,
> 


- -- 
Jehan-Guillaume de Rorthais
DBA
http://www.dalibo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk09eboACgkQXu9L1HbaT6JvwACcDSNQ1c21Vmci5IOgaMrSQDir
x+IAoNPxUu79p98UWBe+pJFqcr9syxtZ
=esw+
-----END PGP SIGNATURE-----


More information about the Pgpool-hackers mailing list