<div dir="ltr">Hey,<div><br></div><div>So there is no way of manually taking a postgresql node out of a pool without interrupting traffic to all other postgresql nodes?</div><div><br></div><div>Cheers,<br></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 3:07 PM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">I cannot imagine how you maintenance the database while a user<br>
connects to the database:-)<br>
<br>
BTW I&#39;m not sure if this is usefull for you or not,<br>
but... pcp_detach_node accepts -g option which force pcp_detach_node<br>
wait until all clients exit.<br>
<br>
</div><div class="">Best regards,<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>
<br>
</div><div class="">&gt; Cool,<br>
&gt;<br>
&gt; Thanks Tatsuo.<br>
&gt;<br>
&gt; Is there a way of taking a postgresql node out of a pool without causing<br>
&gt; connections to other postgresql nodes to drop?<br>
&gt;<br>
&gt; This would be used in a situation such as database maintenance.<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt;<br>
&gt; James Sewell,<br>
&gt; PostgreSQL Team Lead / Solutions Architect<br>
&gt; ______________________________________<br>
&gt;<br>
&gt;<br>
</div><div class="">&gt;  Level 2, 50 Queen St, Melbourne VIC 3000<br>
&gt;<br>
</div>&gt; *P *<a href="tel:%28%2B61%29%203%208370%208000" value="+61383708000">(+61) 3 8370 8000</a>  *W* <a href="http://www.lisasoft.com" target="_blank">www.lisasoft.com</a>  *F *<a href="tel:%28%2B61%29%203%208370%208099" value="+61383708099">(+61) 3 8370 8099</a><br>

<div class="HOEnZb"><div class="h5">&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Fri, Jul 25, 2014 at 2:43 PM, Tatsuo Ishii &lt;<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; &gt; Hey all,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; This is a seemingly a pretty bad problem which I uncovered as part of my<br>
&gt;&gt; &gt; last post, so the start of the message will be similar.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I have two pgpool nodes which I am using a TCP load balancer to spread<br>
&gt;&gt; &gt; between. I am using watchdog to synchronise PostgreSQL node information<br>
&gt;&gt; &gt; between the two and an external HA solution (with ALLOW_TO_FAILOVER).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; If I start both my pgpool nodes up I get the following initial state:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; postgres=# show pool_nodes;<br>
&gt;&gt; &gt;  node_id |  hostname   | port | status | lb_weight |  role<br>
&gt;&gt; &gt; ---------+-------------+------+--------+-----------+---------<br>
&gt;&gt; &gt;  0       | 10.10.10.1   | 5432 | 2      | 0.500000  | standby<br>
&gt;&gt; &gt;  1       | 10.10.10.2   | 5432 | 2      | 0.500000  | primary<br>
&gt;&gt; &gt; (2 rows)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Now I open a PSQL connection and do the following:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; postgres=# SELECT inet_server_addr();<br>
&gt;&gt; &gt;  inet_server_addr<br>
&gt;&gt; &gt; ------------------<br>
&gt;&gt; &gt;  10.10.10.2<br>
&gt;&gt; &gt; (1 row)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; This shows I am connected to the primary.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I can run this multiple times and I will always be connected to the<br>
&gt;&gt; &gt; primary, as long as I don&#39;t close the psql session.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Then from another window I run the following command:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;  pcp_detach_node 1 load_balancer 9898 postgres postgres 0<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; And in the same PSQL session run the command again:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; postgres=# SELECT inet_server_addr();<br>
&gt;&gt; &gt; SSL SYSCALL error: EOF detected<br>
&gt;&gt; &gt; The connection to the server was lost. Attempting reset: Succeeded.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; This is strange. Why has my master connection been severed?<br>
&gt;&gt;<br>
&gt;&gt; It&#39;s an expected behavior of pcp_detach_node, which causes failover<br>
&gt;&gt; and all existing sessions are disconnected.<br>
&gt;&gt;<br>
&gt;&gt; Best regards,<br>
&gt;&gt; --<br>
&gt;&gt; Tatsuo Ishii<br>
&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
&gt;&gt;<br>
&gt;<br>
</div></div><div class="HOEnZb"><div class="h5">&gt; --<br>
&gt;<br>
&gt;<br>
&gt; ------------------------------<br>
&gt; The contents of this email are confidential and may be subject to legal or<br>
&gt; professional privilege and copyright. No representation is made that this<br>
&gt; email is free of viruses or other defects. If you have received this<br>
&gt; communication in error, you may not copy or distribute any part of it or<br>
&gt; otherwise disclose its contents to anyone. Please advise the sender of your<br>
&gt; incorrect receipt of this correspondence.<br>
</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>