<div dir="ltr">Oo, i find copy-past bug, sorry.<div><br></div><div>variable change i-&gt;j<br><div><br></div><div><pre style="color:rgb(0,0,0)">+                                        else if (pg_standby[i] == 0) // up master node
+                                        {
+                                                int lag = 0;
+                                                int j;
+                                                // To allow master node need lag=0 for all standby servers
+                                                for (j=0;j&lt;NUM_BACKENDS;j++)
+                                                        if (VALID_BACKEND(j) &amp;&amp; pg_standby[j] == 1)

<br></pre></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/13 Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for the proposal. I will look into this.<br>
--<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>
<div class="HOEnZb"><div class="h5"><br>
&gt; In streaming master/slave we testing all online nodes in function<br>
&gt; check_replication_time_lag.<br>
&gt;<br>
&gt; I add new feature. I test all nodes include dead nodes.<br>
&gt;<br>
&gt; If down slave node now alive, i compare time_lag with master. And try this<br>
&gt; few times (new param in config sr_check_max_retries) If slave node not far<br>
&gt; behind, i mark node as NODE_UP.<br>
&gt;<br>
&gt; If mater node now is online, i check time_lag on all slave nodes. And if<br>
&gt; lag=0, i think this master is working fine, and reattach it.<br>
&gt;<br>
&gt; This will solved the problem ticket #17<br>
&gt; My implementation see in diff file.<br>
</div></div></blockquote></div><br></div>