<div dir="ltr">I have simulated the exact scenario with pcp commands (not pgpool_adm sql commands) and everything works great!!<div>but I need to use the pgpool_adm command (via sql)......</div><div>any ideas how can I track the disconnection errors?</div><div><br></div><div>Thanks,</div><div>cohavisi</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 4, 2015 at 1:44 AM, Tatsuo Ishii <span dir="ltr"><<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It's an expected behavior. pgpool-II disconnects sessions to client<br>
when failover occurs.<br>
<span class=""><br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
<br>
</span><span class="">> Hi,<br>
> I have another issue regarding detach/attach node via pgpool_adm functions:<br>
> looks like everytime I detach the primary node (in order to trigger a<br>
> failover), the connection to the pgpool get lost:<br>
><br>
><br>
> [root@localhost ~]# psql -U postgres template1 -h 192.168.15.59 -p 9999<br>
> Password for user postgres:<br>
> psql (9.3.1)<br>
> Type "help" for help.<br>
><br>
> template1=# show pool_nodes;<br>
>  node_id |   hostname    | port | status | lb_weight |  role<br>
> ---------+---------------+------+--------+-----------+---------<br>
>  0       | 192.168.15.55 | 5432 | 2      | 0.500000  | primary<br>
>  1       | 192.168.15.56 | 5432 | 2      | 0.500000  | standby<br>
> (2 rows)<br>
><br>
><br>
> template1=#<br>
> template1=#<br>
> template1=#<br>
> template1=# select<br>
> pcp_detach_node(0,False,'192.168.15.59',500,9898,'usr','pass');<br>
>  pcp_detach_node<br>
> -----------------<br>
>  t<br>
> (1 row)<br>
><br>
> template1=# show pool_nodes;<br>
</span>> *The connection to the server was lost. Attempting reset:*<br>
> *Succeeded.*<br>
<span class="">> template1=# show pool_nodes;<br>
>  node_id |   hostname    | port | status | lb_weight |  role<br>
> ---------+---------------+------+--------+-----------+---------<br>
>  0       | 192.168.15.55 | 5432 | 3      | 0.500000  | standby<br>
>  1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary<br>
> (2 rows)<br>
><br>
><br>
> template1=# select pcp_attach_node(0,'192.168.15.59',500,9898,'usr','pass');<br>
</span>> *The connection to the server was lost. Attempting reset: Succeeded.*<br>
<div class="HOEnZb"><div class="h5">> template1=# select pcp_attach_node(0,'192.168.15.59',500,9898,'usr','pass');<br>
>  pcp_attach_node<br>
> -----------------<br>
>  t<br>
> (1 row)<br>
><br>
><br>
><br>
> template1=# show pool_nodes;<br>
>  node_id |   hostname    | port | status | lb_weight |  role<br>
> ---------+---------------+------+--------+-----------+---------<br>
>  0       | 192.168.15.55 | 5432 | 1      | 0.500000  | standby<br>
>  1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary<br>
> (2 rows)<br>
><br>
> template1=# show pool_nodes;<br>
>  node_id |   hostname    | port | status | lb_weight |  role<br>
> ---------+---------------+------+--------+-----------+---------<br>
>  0       | 192.168.15.55 | 5432 | 1      | 0.500000  | standby<br>
>  1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary<br>
> (2 rows)<br>
><br>
> template1=# show pool_nodes;<br>
>  node_id |   hostname    | port | status | lb_weight |  role<br>
> ---------+---------------+------+--------+-----------+---------<br>
>  0       | 192.168.15.55 | 5432 | 1      | 0.500000  | standby<br>
>  1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary<br>
><br>
><br>
> template1=# show pool_nodes;<br>
>  node_id |   hostname    | port | status | lb_weight |  role<br>
> ---------+---------------+------+--------+-----------+---------<br>
>  0       | 192.168.15.55 | 5432 | 2      | 0.500000  | standby<br>
>  1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary<br>
> (2 rows)<br>
><br>
> template1=#<br>
><br>
><br>
> Please advise.....<br>
><br>
> cohavisi<br>
><br>
><br>
> On Thu, Oct 29, 2015 at 1:50 PM, Shay Cohavi <<a href="mailto:cohavisi@gmail.com">cohavisi@gmail.com</a>> wrote:<br>
><br>
>> Thanks!!!!<br>
>> I'm using postgres 9.3.1 !<br>
>><br>
>><br>
>> On Thu, Oct 29, 2015 at 8:58 AM, Tatsuo Ishii <<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>><br>
>> wrote:<br>
>><br>
>>> >> *pcp_node_info*<br>
>>> >><br>
>>> >> template1=# select<br>
>>> pcp_node_info(0,'192.168.15.59',500,9898,'user','pass');<br>
>>> >> The connection to the server was lost. Attempting reset: Failed.<br>
>>> >> !><br>
>>> ><br>
>>> > Will look into this.<br>
>>><br>
>>> Assuming you are using PostgreSQL 9.4, I found some compiler warnings<br>
>>> with the source file. Please try attached patches.<br>
>>><br>
>>> Best regards,<br>
>>> --<br>
>>> Tatsuo Ishii<br>
>>> SRA OSS, Inc. Japan<br>
>>> English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
>>> Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
>>><br>
>><br>
>><br>
</div></div></blockquote></div><br></div>