[pgpool-hackers: 258] Re: Patch for new parameter for searching primary node timeout

Tatsuo Ishii ishii at postgresql.org
Mon May 27 23:07:11 JST 2013


Hi Usama,

Welcome to pgpool developer's community!

> I have been working on pgpool-II TODO item to add a new configuration
> parameter for searching the primary node timeout after failover. Currently
> pgpool-II uses "recovery_timeout" config parameter as a timeout for
> searching the primary node after failover which is not originally meant for
> the purpose.
> The attached small patch is my first pgpool-II patch which adds the new
> configuration parameter "search_primary_node_timeout", which can be used
> for setting the timeout for searching the primary node after failover.

I have looked into the patch. Here's my comment.  First, you need
patch for doc/pgpool-en.html.

Second, 

+search_primary_node_timeout = 90
+                                   # Timeout in seconds to search for the
+                                   # primary node at failover
+                                   # 0 means no wait

I am not sure what you suppose when search_primary_node_timeout = 0.
If you mean retrying forever, the code below does not do that. Rather,
find_primary_node() is never called, thus
find_primary_node_repeatedly() always returns -1.

+	for (sec = 0; sec < pool_config->search_primary_node_timeout; sec++)
 	{
 		node_id = find_primary_node();

Third, the default timeout 90 seconds seems too long. Promoting to
primary should take less than 10 seconds unless there's huge back log
of WAL. What about set the default to 10?
--
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-hackers mailing list