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

Tatsuo Ishii ishii at sraoss.co.jp
Mon Jan 24 14:38:33 UTC 2011


> 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

Thinking a little bit more, there seems to be an use case where it's
not a good idea. Consider a heavyly read system rarely updated. In a
case data is not so often updated, maybe once a day. Nodes that were
not promoted do not have old data until daily updation occurs. So
there's no need to degenerate those nodes until that. If you do not
like this, you could always use "delay_threthold". I admit that
there's a case immediate degeration is appropreate. So we may need a
switch to control the behavior.

>> 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.

I'll catch up the discussion.

BTW how can we determine the promoting standby has finished the
reconvery and become ok to accept write queries?

> 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-----
> _______________________________________________
> Pgpool-hackers mailing list
> Pgpool-hackers at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/pgpool-hackers


More information about the Pgpool-hackers mailing list