<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div><div>Hi Tatsuo<br><div><br><div>Thanks for the prompt response and for the patch ! I am glad you could reproduce it.<br><div><br>I am leaving now for a long week-end (monday is holiday in Belgium) and I am not familiar with patches to do it right now, but I'll definitively try when I am back. <br></div></div></div></div><div><div><br>Have a good week-end</div><br></div><div class="ydp6dd2c6fbsignature">Pierre</div></div>
            <div><br></div><div><br></div>
            
            <div id="ydp1ca4caaeyahoo_quoted_7691208710" class="ydp1ca4caaeyahoo_quoted">
                <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                    
                    <div>
                        On Saturday, May 19, 2018, 3:50:28 AM GMT+2, Tatsuo Ishii &lt;ishii@sraoss.co.jp&gt; wrote:
                    </div>
                    <div><br></div>
                    <div><br></div>
                    <div><div dir="ltr">Pierre,<br clear="none"><br clear="none">&gt; Hi,<br clear="none">&gt; I have a problem with pgpool 3.7.2 and pgpool 3.7.3, but not with pgpool 3.7.1 so it might be a bug.<br clear="none">&gt; When there is a failover from node 1 to node 0 then the parameter %P (old primary id) which is passed to the failover script is incorrect. It says 0 instead of 1. I encounter the error systematically when I do a first failover from node 0 to node 1, then a recovery of node 0, then a new failover from node 1 to node 0. In this new failover - from node 1 to node 0 - the parameter old_primary_id is not correctly passed.<br clear="none">&gt; I have reverted back to pgpool 3.7.1 and the problem has disappeared.<br clear="none">&gt; My config, for failover_command, is:<br clear="none">&gt; failover_command = '/scripts/failover.sh %d %h %p %D %m %H %M %P %r %R'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Executes this command at failover&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Special values:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#&nbsp; &nbsp;%d = node id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#&nbsp; &nbsp;%h = host name&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#&nbsp; &nbsp;%p = port number&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#&nbsp; &nbsp;%D = database cluster path&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#&nbsp; &nbsp;%m = new master node id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#&nbsp; &nbsp;%H = hostname of the new master node&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#&nbsp; &nbsp;%M = old master node id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#&nbsp; &nbsp;%P = old primary node id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#&nbsp; &nbsp;%r = new master port number<br clear="none">&gt; and in the log I see that the parameter %P is incorrect with pgpool 3.7.3 and pgpool 3.7.2 but that it is correct with pgpool 3.7.1<br clear="none">&gt; I can provide more logs and configuration if needed<br clear="none">&gt; Kind regards,&nbsp;<br clear="none">&gt; Pierre <br clear="none"><br clear="none">Thanks for the report. I was able to reproduce the problem. I think<br clear="none">problem with 3.7.2 and 3.7.3 is, they pass node id 0 if current<br clear="none">primary node's status is down. Of course the status is down because<br clear="none">it's the reason why the failover script gets called:-&lt; 3.7.1 does not<br clear="none">check the primary node status. So it correctly passes the failed<div class="ydp1ca4caaeyqt5216287374" id="ydp1ca4caaeyqtfd69234"><br clear="none">primary node id.</div><br clear="none"><br clear="none">I think the fix would be passes the primary node id regardless the<br clear="none">status. Attached one line patch does the trick. At least it worked for<br clear="none">me. So can you please try it out?<br clear="none"><br clear="none">Best regards,<br clear="none">--<br clear="none">Tatsuo Ishii<br clear="none">SRA OSS, Inc. Japan<br clear="none">English: <a shape="rect" href="http://www.sraoss.co.jp/index_en.php" rel="nofollow" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br clear="none">Japanese:<a shape="rect" href="http://www.sraoss.co.jp" rel="nofollow" target="_blank">http://www.sraoss.co.jp</a></div></div>
                </div>
            </div></div></body></html>