<div dir="ltr">I had a look in the logs and this shows directly after the pcp_detach. <div><br></div><div>In this environment 10.51.9.227 is the standby database, it is node_id 0.<br><div><br></div><div><div>2014-07-25 13:39:40 LOG:   pid 11286: wd_start_interlock: start interlocking</div>
<div>2014-07-25 13:39:40 LOG:   pid 11286: starting degeneration. shutdown host 10.51.9.227(5432)</div><div>2014-07-25 13:39:40 LOG:   pid 11286: Restart all children</div><div>2014-07-25 13:39:40 DEBUG: pid 11303: child received shutdown request signal 3</div>
<div>2014-07-25 13:39:40 DEBUG: pid 11304: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11305: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11306: child received shutdown request signal 3</div>
<div>2014-07-25 13:39:40 DEBUG: pid 11307: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11308: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11309: child received shutdown request signal 3</div>
<div>2014-07-25 13:39:40 DEBUG: pid 11310: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11311: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11312: child received shutdown request signal 3</div>
<div>2014-07-25 13:39:40 DEBUG: pid 11313: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11314: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11315: child received shutdown request signal 3</div>
<div>2014-07-25 13:39:40 DEBUG: pid 11316: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11317: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11318: child received shutdown request signal 3</div>
<div>2014-07-25 13:39:40 DEBUG: pid 11319: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11320: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11321: child received shutdown request signal 3</div>
<div>2014-07-25 13:39:40 DEBUG: pid 11322: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11323: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11324: child received shutdown request signal 3</div>
<div>2014-07-25 13:39:40 DEBUG: pid 11325: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11326: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11327: child received shutdown request signal 3</div>
<div>2014-07-25 13:39:40 DEBUG: pid 11328: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11329: child received shutdown request signal 3</div><div>2014-07-25 13:39:40 DEBUG: pid 11330: child received shutdown request signal 3</div>
<div>2014-07-25 13:39:40 DEBUG: pid 11331: child received shutdown request signal 3</div><div>2014-07-25 13:39:41 DEBUG: pid 11332: child received shutdown request signal 3</div><div>2014-07-25 13:39:41 LOG:   pid 11286: find_primary_node_repeatedly: waiting for finding a primary node</div>
<div>2014-07-25 13:39:41 LOG:   pid 11286: find_primary_node: primary node id is 1</div><div>2014-07-25 13:39:41 LOG:   pid 11286: wd_end_interlock: end interlocking</div><div>2014-07-25 13:39:41 LOG:   pid 11286: failover: set new primary node: 1</div>
<div>2014-07-25 13:39:41 LOG:   pid 11286: failover: set new master node: 1</div><div>2014-07-25 13:39:42 LOG:   pid 11336: worker process received restart request</div><div>2014-07-25 13:39:42 LOG:   pid 11286: failover done. shutdown host 10.51.9.227(5432)</div>
</div><div><br></div><div>Cheers,</div><div><br></div></div></div><div class="gmail_extra"><br clear="all"><div><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>
<br><br><div class="gmail_quote">On Fri, Jul 25, 2014 at 10:43 AM, 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">Hey all,<div><br></div><div>This is a seemingly a pretty bad problem which I uncovered as part of my last post, so the start of the message will be similar.</div><div><br></div><div><div style="font-family:arial,sans-serif;font-size:13px">

I have two pgpool nodes which I am using a TCP load balancer to spread between. I am using watchdog to synchronise PostgreSQL node information between the two and an external HA solution (with ALLOW_TO_FAILOVER).</div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">If I start both my pgpool nodes up I get the following initial state:<br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">

<div>postgres=# show pool_nodes;</div><div> node_id |  hostname   | port | status | lb_weight |  role</div><div>---------+-------------+------+--------+-----------+---------</div><div> 0       | 10.10.10.1   | 5432 | 2      | 0.500000  | standby</div>

<div> 1       | 10.10.10.2   | 5432 | 2      | 0.500000  | primary</div><div>(2 rows)</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">

Now I open a PSQL connection and do the following:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>postgres=# SELECT inet_server_addr();</div>

<div> inet_server_addr</div><div>------------------</div><div> 10.10.10.2  </div><div>(1 row)</div><div><br></div></div><div style="font-family:arial,sans-serif;font-size:13px"><span style="font-size:small">This shows I am connected to the primary.</span></div>

<div style="font-family:arial,sans-serif;font-size:13px"><span style="font-size:small"><br></span></div><div style="font-family:arial,sans-serif;font-size:13px"><span style="font-size:small">I can run this multiple times and I will always be connected to the primary, as long as I don&#39;t close the psql session.</span></div>

<div style="font-family:arial,sans-serif;font-size:13px"><span style="font-size:small"><br></span></div><div style="font-family:arial,sans-serif;font-size:13px">Then from another window I run the following command:<br></div>

<div><font face="arial, sans-serif"><br></font></div><div><span style="font-family:arial,sans-serif;font-size:13px"> pcp_detach_node 1 load_balancer 9898 postgres postgres 0</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">And in the same PSQL session run the command again:</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><div>postgres=# SELECT inet_server_addr();</div><div>SSL SYSCALL error: EOF detected</div><div>The connection to the server was lost. Attempting reset: Succeeded.</div>

<div><br></div><div>This is strange. Why has my master connection been severed?</div><div><br></div><div><span style="color:rgb(50,59,98);font-family:Arial,Helvetica,sans-serif;font-size:14px;font-weight:bold">James Sewell,</span><br>

</div></span></div><div><div style="color:rgb(184,39,106);font-weight:bold;font-style:normal;font-variant:normal;font-size:14px;line-height:normal;font-family:Arial,Helvetica,sans-serif">
        <span style="color:rgb(169,169,169)"><span style="font-style:normal;font-variant:normal;font-weight: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-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>
</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>