<div dir="ltr">Hi <span class="" style="background-color:yellow">Tatsuo</span><div><br><div style>Please find the updated patch which takes care of the comments and suggestions on the previous version.</div></div><div style>
Appart from documentation additions, the attached patch sets the default search_primary_node_timeout value to 10 and setting the same to 0 will make the pgpool-II to keep searching the primary node forever.</div><div style>
<br></div><div style>Thanks</div><div style>Muhammad Usama</div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 27, 2013 at 7:32 PM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">&gt; Hi Tatsuo<br>
&gt;<br>
&gt; Thanks for the comments and review. I will submit the updated patch after<br>
&gt; taking care of the comments.<br>
&gt; Please just clarify on one of the points, what should be the correct<br>
&gt; behaviour of setting the search_primary_node_timeout = 0<br>
&gt;<br>
&gt; Retrying forever OR  Try just one time.?<br>
&gt;<br>
&gt; Thanks<br>
&gt; Usama<br>
<br>
</div>I vote for &quot;retrying forever&quot;.<br>
<div class="HOEnZb"><div class="h5">--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
<br>
&gt; On Mon, May 27, 2013 at 7:07 PM, Tatsuo Ishii &lt;<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Hi Usama,<br>
&gt;&gt;<br>
&gt;&gt; Welcome to pgpool developer&#39;s community!<br>
&gt;&gt;<br>
&gt;&gt; &gt; I have been working on pgpool-II TODO item to add a new configuration<br>
&gt;&gt; &gt; parameter for searching the primary node timeout after failover.<br>
&gt;&gt; Currently<br>
&gt;&gt; &gt; pgpool-II uses &quot;recovery_timeout&quot; config parameter as a timeout for<br>
&gt;&gt; &gt; searching the primary node after failover which is not originally meant<br>
&gt;&gt; for<br>
&gt;&gt; &gt; the purpose.<br>
&gt;&gt; &gt; The attached small patch is my first pgpool-II patch which adds the new<br>
&gt;&gt; &gt; configuration parameter &quot;search_primary_node_timeout&quot;, which can be used<br>
&gt;&gt; &gt; for setting the timeout for searching the primary node after failover.<br>
&gt;&gt;<br>
&gt;&gt; I have looked into the patch. Here&#39;s my comment.  First, you need<br>
&gt;&gt; patch for doc/pgpool-en.html.<br>
&gt;&gt;<br>
&gt;&gt; Second,<br>
&gt;&gt;<br>
&gt;&gt; +search_primary_node_timeout = 90<br>
&gt;&gt; +                                   # Timeout in seconds to search for the<br>
&gt;&gt; +                                   # primary node at failover<br>
&gt;&gt; +                                   # 0 means no wait<br>
&gt;&gt;<br>
&gt;&gt; I am not sure what you suppose when search_primary_node_timeout = 0.<br>
&gt;&gt; If you mean retrying forever, the code below does not do that. Rather,<br>
&gt;&gt; find_primary_node() is never called, thus<br>
&gt;&gt; find_primary_node_repeatedly() always returns -1.<br>
&gt;&gt;<br>
&gt;&gt; +       for (sec = 0; sec &lt; pool_config-&gt;search_primary_node_timeout;<br>
&gt;&gt; sec++)<br>
&gt;&gt;         {<br>
&gt;&gt;                 node_id = find_primary_node();<br>
&gt;&gt;<br>
&gt;&gt; Third, the default timeout 90 seconds seems too long. Promoting to<br>
&gt;&gt; primary should take less than 10 seconds unless there&#39;s huge back log<br>
&gt;&gt; of WAL. What about set the default to 10?<br>
&gt;&gt; --<br>
&gt;&gt; Tatsuo Ishii<br>
&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt;&gt; Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
&gt;&gt;<br>
</div></div></blockquote></div><br></div>