<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi all,<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I&#8217;m kindly asking for your expertise on a problem we have with PGPool and failover.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Our setup contains two database servers, one running as primary and one as slave.<o:p></o:p></p><p class=MsoNormal>We installed automatic failover and it seems to be working very well when the primary node goes down.<o:p></o:p></p><p class=MsoNormal>The standby server is promoted to primary and our java application continues working with no problems.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>The problem that we have occurs when a slave node goes down.<o:p></o:p></p><p class=MsoNormal>PGPool starts being busy and PGPoolAdmin does not open any pages but it keeps waiting server responses for long (until timeout).<o:p></o:p></p><p class=MsoNormal>When I try to stop pgpool from the command line on the server, it just won&#8217;t do it, but it keeps stopping it forever.<o:p></o:p></p><p class=MsoNormal>If I start again the failed slave, I can see in postgres logs that it connects to the primary node for replication, but I&#8217;m not able to open the PGPoolAdmin status page to click the Return button.<o:p></o:p></p><p class=MsoNormal>PGPool seems to be waiting for something, but I&#8217;m not able to understand what is it.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>We use pgpool2-V3_2_STABLE, checked out from the repository (4-Oct-2012).<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>In pgpool.conf we have set<o:p></o:p></p><p class=MsoNormal>fail_over_on_backend_error:&nbsp;&nbsp;&nbsp; /usr/local/etc/failover.sh %d &quot;%h&quot; %p %D %m %M &quot;%H&quot; %P <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>and in failover.sh:<o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>if [ $failed_node_id = $old_primary_node_id ];then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # master failed<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; touch $trigger&nbsp;&nbsp; # let standby take over<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; echo &quot;Primary database &quot;$failed_host_name&quot; failed, please check the status of your replication system. Trigger used: &quot;$trigger | mail -s &quot;Ditaweb primary database failed&quot; $admin_email<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>else<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; echo &quot;Slave database &quot;$failed_host_name&quot; failed, please check the status of your replication system.&quot; | mail -s &quot;Ditaweb slave database failed&quot; $admin_email<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>fi<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>The above script works fine as the &#8216;slave failed&#8217; email is sent, and in the case when the primary node goes down failover is executed successfully.<o:p></o:p></p><p class=MsoNormal>I&#8217;ve also attached pgpool.conf in case you need it.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>So, I guess the question is what makes PGPool having this behavior?<o:p></o:p></p><p class=MsoNormal>Is it something that we need to setup in pgpool.conf, some kind of timeout?<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Thank you in advance for you time,<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Regards,<o:p></o:p></p><p class=MsoNormal>Stelios Limnaios<o:p></o:p></p></div></body></html>