<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div>Hello,<br><br></div>Tried everything and it looks like may be a bug.<br><br><br></div>Configuration with three nodes, streaming mode:<br><br>---------------<br><br>backend_hostname0 = &#39;10.2.2.2&#39;<br>backend_port0 = 5432<br>backend_weight0 = 1<br>#backend_data_directory0 = &#39;/data&#39;<br>#backend_flag0 = &#39;DISALLOW_TO_FAILOVER&#39;<br><br>backend_hostname1 = &#39;localhost&#39;<br>backend_port1 = 5432<br><br>backend_hostname2 = &#39;10.5.5.5&#39;<br>backend_port2 = 5432<br>backend_weight2 = 1<br>#backend_flag2 = &#39;DISALLOW_TO_FAILOVER&#39;<br><br><br># - Authentication -<br><br>enable_pool_hba = true<br><br>num_init_children = 128<br>max_pool = 128<br><br># - Life time -<br>child_life_time = 30<br>child_max_connections = 0<br>connection_life_time = 120<br>client_idle_limit = 90<br><br>connection_cache = on<br>reset_query_list = &#39;ABORT; DISCARD ALL&#39;<br>replication_mode = off<br>replicate_select = off<br><br>insert_lock = on<br>lobj_lock_table = &#39;&#39;<br><br><br># - Degenerate handling -<br>replication_stop_on_mismatch = off<br>failover_if_affected_tuples_mismatch = off<br><br>load_balance_mode = on <br>ignore_leading_white_space = on<br>white_function_list = &#39;&#39;<br>black_function_list = &#39;currval,lastval,nextval,setval&#39;<br><br>master_slave_mode = on<br>master_slave_sub_mode = &#39;stream&#39;<br><br># - Streaming -<br><br>sr_check_period = 10<br>sr_check_user = &#39;user&#39;<br>sr_check_password = &#39;password&#39;<br>delay_threshold = 100<br><br>parallel_mode = off<br>enable_query_cache = off<br>health_check_period = 0<br></div><div><br># Failover<br></div><div><br>failover_command = &#39;&#39;<br>failback_command = &#39;&#39;<br>fail_over_on_backend_error = on<br><br>relcache_expire = 0<br><br>------------------<br><br></div><div>All backends are Postgresql 9.1<br></div><div><br><br># show pool_nodes;<br> node_id |   hostname    | port | status | lb_weight |  role<br>---------+---------------+------+--------+-----------+---------<br> 0       | 10.2.2.2 | 5432 | 2      | 0.333333  | primary<br> 1       | localhost     | 5432 | 2      | 0.333333  | standby<br> 2       | 10.5.2.2   | 5432 | 2      | 0.333333  | standby<br>(3 rows)<br><br></div><div><br>WHAT HAPPENS:<br><br></div>1. Node 2 is restarted and pgpool automatically detects and takes it out of circulation.<br></div><div>2. Node 2 is back up.<br></div>3. We reattach node 2:<br>$ pcp_attach_node -d 1 localhost 9898 postgres postgres 2<br>DEBUG: send: tos=&quot;R&quot;, len=46<br>DEBUG: recv: tos=&quot;r&quot;, len=21, data=AuthenticationOK<br>DEBUG: send: tos=&quot;D&quot;, len=6<br>DEBUG: recv: tos=&quot;c&quot;, len=20, data=CommandComplete<br>DEBUG: send: tos=&quot;X&quot;, len=4<br><br><br>log:<br><br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2915073: send_failback_request: fail back 2 th node request from pid 2915073<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2899688: starting fail back. reconnect host 10.5.2.2 (5432)<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2899688: Do not restart children because we are failbacking node id 2 host10.5.2.2  port:5432 and we are in streaming replication mode<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2899688: find_primary_node_repeatedly: waiting for finding a primary node<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2899688: find_primary_node: primary node id is 0<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2899688: failover: set new primary node: 0<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2899688: failover: set new master node: 0<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2899688: failback done. reconnect host 10.5.2.2(5432)<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2915074: worker process received restart request<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2915084: do_child: failback event found. restart myself.<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2915166: do_child: failback event found. restart myself.<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2915195: do_child: failback event found. restart myself.<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2915197: do_child: failback event found. restart myself.<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2915108: do_child: failback event found. restart myself.<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2915141: do_child: failback event found. restart myself.<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2915094: do_child: failback event found. discard existing connections<br>Oct 30 23:30:38 web02 pgpool: 2014-10-30 23:30:38 LOG:   pid 2915087: do_child: failback event found. discard existing connections<br>Oct 30 23:30:39 web02 pgpool: 2014-10-30 23:30:39 LOG:   pid 2915073: pcp child process received restart request<br>Oct 30 23:30:39 web02 pgpool: 2014-10-30 23:30:39 LOG:   pid 2899688: PCP child 2915073 exits with status 256 in failover()<br>Oct 30 23:30:39 web02 pgpool: 2014-10-30 23:30:39 LOG:   pid 2899688: fork a new PCP child pid 2915325 in failover()<br>Oct 30 23:30:39 web02 pgpool: 2014-10-30 23:30:39 LOG:   pid 2899688: worker child 2915074 exits with status 256<br>Oct 30 23:30:39 web02 pgpool: 2014-10-30 23:30:39 LOG:   pid 2899688: fork a new worker child pid 2915326<br><br><br># show pool_nodes;<br> node_id |   hostname    | port | status | lb_weight |  role<br>---------+---------------+------+--------+-----------+---------<br> 0       | 10.2.2.2 | 5432 | 2      | 0.333333  | primary<br> 1       | localhost     | 5432 | 2      | 0.333333  | standby<br> 2       | 10.5.2.2   | 5432 | 2      | 0.333333  | standby<br>(3 rows)<br><br></div>Yet the node does not receive any queries.<br></div>pgpool2 reload does not help.<br><br></div>Only full restart of pgpool make it back to normal:<br></div><div><br>$ pgpool2 restart<br><br></div><div>Log:<br><br>received fast shutdown request<br>Oct 30 23:56:10 web02 pgpool: 2014-10-30 23:56:10 LOG:   pid 2899688: pgpool main: close listen socket<br>Oct 30 23:56:10 web02 pgpool: 2014-10-30 23:56:10 ERROR: pid 2899688: Could not open status file /var/log/postgresql/pgpool_status<br>Oct 30 23:56:11 web02 pgpool: 2014-10-30 23:56:11 LOG:   pid 2919540: pgpool-II successfully started. version 3.3.4 (tokakiboshi)<br>Oct 30 23:56:11 web02 pgpool: 2014-10-30 23:56:11 LOG:   pid 2919540: find_primary_node: primary node id is 0<br><br><br></div>If node is reported with status =2 and not receiving queries, it must be a bug.<br><br></div>This was working fine with same configuration on pgpool2 3.1.3.  <br></div>Does not work after upgrade to pgpool 3.3.4<br><br></div>Or is there anything wrong in my setup? <br></div>Thank you!<br></div>