<div dir="ltr">Hello,<div><br></div><div>Can anyone comment on if this is expected behavior?</div><div><br></div><div>I can&#39;t seem to produce a configuration where a short network outage to the standby node doesn&#39;t result in one of the following happening:</div><div><br></div><div>a) No new connections being accepted to the master until the node returns</div><div>b) (Eventually) The standby node being marked as status=3 and never being returned to service</div><div><br></div><div>Is there a way round this?</div><div><br></div><div>It can be tested by setting up PGPool then running /sbin/iptables -A INPUT -p tcp --destination-port 5432 -j DROP on the standby and trying to connect.</div><div><br></div><div>Cheers,</div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div style="color:#b8276a;font:bold 14px Arial,Helvetica,sans-serif">
        <br>
        <span style="color:#323b62">James Sewell,</span><br>
        <span style="color:#a9a9a9"><span style="font:12px Arial,Helvetica,sans-serif">PostgreSQL Team Lead / Solutions Architect </span></span><br>
        <span style="color:#a9a9a9">______________________________________</span><br>
         </div>
<img alt="" src="http://www.lisasoft.com/sites/lisasoft/files/u1/logo1.jpg" style="margin:0px;width:153px;height:50px"><br>
<div style="font:normal 12px/20px Arial,Helvetica,sans-serif;color:#404040;margin:0">
        <span style="color:#a9a9a9">Level 2, 50 Queen St, Melbourne VIC 3000</span><br>
        <br>
        <strong>P </strong><span style="color:#a9a9a9"><span style="font-family:Arial,Verdana,sans-serif">(+61) 3 8370 8000</span></span><span style="color:rgb(169,169,169)"> </span><strong> </strong><span style="color:rgb(50,59,98)"><span style="width:15px;display:inline-block"><strong>W</strong></span></span> <a style="color:rgb(64,64,64);margin:2px 0px;text-decoration:none"><span style="color:#a9a9a9">www.lisasoft.com</span></a>  <span style="color:rgb(50,59,98)"><span style="width:15px;display:inline-block"><strong>F </strong></span></span><span style="color:#a9a9a9"><span style="font-family:Arial,Verdana,sans-serif">(+61) 3 8370 8099</span></span></div>
<div style="padding-top:8px">
         </div></div></div>
<br><div class="gmail_quote">On Tue, Mar 29, 2016 at 3:36 PM, James Sewell <span dir="ltr">&lt;<a href="mailto:james.sewell@lisasoft.com" target="_blank">james.sewell@lisasoft.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>I&#39;m running pgpool-II version 3.3.4 (tokakiboshi) with two  9.3.1.3 nodes.</div><div><br></div><div>I have the following in my config file:</div><div><br></div><div><div><font face="monospace, monospace"># - Backend Connection Settings -</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">backend_hostname0 = &#39;10.51.9.125&#39;</font></div><div><font face="monospace, monospace">backend_port0 = 5432</font></div><div><font face="monospace, monospace">backend_weight0 = 1</font></div><div><font face="monospace, monospace">backend_data_directory0 = &#39;/apps/pg_data/data&#39;</font></div><div><font face="monospace, monospace">backend_flag0 = &#39;ALLOW_TO_FAILOVER&#39;</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">backend_hostname1 = &#39;10.51.10.116&#39;</font></div><div><font face="monospace, monospace">backend_port1 = 5432</font></div><div><font face="monospace, monospace">backend_weight1 = 1</font></div><div><font face="monospace, monospace">backend_data_directory1 = &#39;/apps/pg_data/data&#39;</font></div><div><font face="monospace, monospace">backend_flag1 = &#39;ALLOW_TO_FAILOVER&#39;</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">...</font></div><div><font face="monospace, monospace"><br></font></div><div><div style="font-family:monospace,monospace">master_slave_mode = on                                </div><div style="font-family:monospace,monospace">master_slave_sub_mode = &#39;stream&#39;</div><div style="font-family:monospace,monospace"><br></div><div style="font-family:monospace,monospace">...</div><div style="font-family:monospace,monospace"><br></div><div><div style="font-family:monospace,monospace">health_check_period = 5</div><div style="font-family:monospace,monospace">health_check_timeout = 10</div><div style="font-family:monospace,monospace">health_check_max_retries = 5</div><div style="font-family:monospace,monospace">health_check_retry_delay = 1</div><div style="font-family:monospace,monospace"><br></div><div style="font-family:monospace,monospace">...</div><div style="font-family:monospace,monospace"><br></div><div style="font-family:monospace,monospace">fail_over_on_backend_error = off</div><div style="font-family:monospace,monospace"><br></div><div><font face="arial, helvetica, sans-serif">This mostly works as expected. I am using a third party clustering solution which uses pcp_detach_node for fencing - although I don&#39;t think that is relevant here.</font></div><div><br></div><div>I get the following node info when up:</div><div><br></div><div><div><font face="monospace, monospace">node_id |   hostname   | port | status | lb_weight |  role</font></div><div><font face="monospace, monospace">---------+--------------+------+--------+-----------+---------</font></div><div><font face="monospace, monospace"> 0       | 10.51.9.125  | 5432 | 2      | 0.500000  | primary</font></div><div><font face="monospace, monospace"> 1       | 10.51.10.116 | 5432 | 3      | 0.500000  | standby</font></div><div><font face="monospace, monospace">(2 rows)</font></div></div><div><br></div><div><font face="arial, helvetica, sans-serif">The problem comes when my standby node becomes unavailable - let&#39;s say I shut it down.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Now until all my health checks have failed I am not able to connect to the database:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><div><font face="monospace, monospace">-bash-4.1$ psql</font></div><div><font face="monospace, monospace">psql.bin: -bash-4.1$</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">My network is pretty temperamental, so I actually would like to lengthen the time to failure - but this means I get a complete outage every time my network flutters?</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">I could also change the setting of </font><span style="font-family:monospace,monospace">fail_over_on_backend_error</span><span style="font-family:monospace,monospace"> </span><font face="arial, helvetica, sans-serif">but then although the failure is immediate there is no coming back without intervention once my server is set to a status of 3.</font></div></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Is there a way of avoiding this behavior and allowing traffic to continue to be processed on my functioning master when the standby is in question?</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Cheers,</font></div></div></div><div><div><div><div><div style="color:rgb(184,39,106);font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14px;line-height:normal;font-family:Arial,Helvetica,sans-serif">
        <br>
        <span style="color:rgb(50,59,98)">James Sewell,</span><br>
        <span style="color:rgb(169,169,169)"><span style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Arial,Helvetica,sans-serif">PostgreSQL Team Lead / Solutions Architect </span></span><br>
        <span style="color:rgb(169,169,169)">______________________________________</span><br>
         </div>
<img alt="" src="http://www.lisasoft.com/sites/lisasoft/files/u1/logo1.jpg" style="margin:0px;width:153px;min-height:50px"><br>
<div style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:20px;font-family:Arial,Helvetica,sans-serif;color:rgb(64,64,64);margin:0px">
        <span style="color:rgb(169,169,169)">Level 2, 50 Queen St, Melbourne VIC 3000</span><br>
        <br>
        <strong>P </strong><span style="color:rgb(169,169,169)"><span style="font-family:Arial,Verdana,sans-serif"><a href="tel:%28%2B61%29%203%208370%208000" value="+61383708000" target="_blank">(+61) 3 8370 8000</a></span></span><span style="color:rgb(169,169,169)"> </span><strong> </strong><span style="color:rgb(50,59,98)"><span style="width:15px;display:inline-block"><strong>W</strong></span></span> <a style="color:rgb(64,64,64);margin:2px 0px;text-decoration:none"><span style="color:rgb(169,169,169)">www.lisasoft.com</span></a>  <span style="color:rgb(50,59,98)"><span style="width:15px;display:inline-block"><strong>F </strong></span></span><span style="color:rgb(169,169,169)"><span style="font-family:Arial,Verdana,sans-serif"><a href="tel:%28%2B61%29%203%208370%208099" value="+61383708099" target="_blank">(+61) 3 8370 8099</a></span></span></div>
<div style="padding-top:8px">
         </div></div></div>
</div></div></div></div>
</blockquote></div><br></div>

<br>
<p><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14.545454025268555px;background-color:rgb(255,255,255)"><hr><font size="1" color="Gray" face="Arial">The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.</font></div></p>