<div dir="ltr">Hi,<div>I have a three nodes PgPool 4.0.2 cluster on proxy1, proxy2, proxy3 (master) with a three nodes PostgresSQL 11 on postgres1 (master), postgres2, postgres3.</div><div><br></div><div>Today I was making some failover-recovery tests and everything was running fine, but since about 3 hours the PgPool master node does not get the consensus from other PgPool node to make the failover when the primary PostgreSQL node goes down even if the PgPool cluster is up and running and healthy.</div><div><br></div><div>When the primary PostgreSQL node is up and running, the cluster is healthy:</div><div>=================================== 8&lt; ?============================================</div><div>postgres@proxy3:~$ psql -h 127.0.0.1 -p 5432 -U repmgr -c &quot;show pool_nodes;&quot;<br>DEBUG:  SimpleQuery<br>DETAIL:  nodes reporting<br> node_id | hostname  | port | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay | last_status_change  <br>---------+-----------+------+--------+-----------+---------+------------+-------------------+-------------------+---------------------<br> 0       | postgres1 | 5432 | up     | 0.333333  | primary | 0          | true              | 0                 | 2019-10-28 17:34:05<br> 1       | postgres2 | 5432 | up     | 0.333333  | standby | 11         | false             | 0                 | 2019-10-28 18:23:39<br> 2       | postgres3 | 5432 | up   | 0.333333  | standby | 0          | false             | 0                 | 2019-10-28 17:35:27<br>(3 rows)<br>=================================== 8&lt; ?============================================</div><div><br></div><div>The PgPool cluster is healthy and the VIP IP address is on the master node:</div><div>=================================== 8&lt; ?============================================<br></div>postgres@proxy3:~$ pcp_watchdog_info -h 192.168.175.30 -p 9898 -w -v<br>Watchdog Cluster Information <br>Total Nodes          : 3<br>Remote Nodes         : 2<br>Quorum state         : QUORUM EXIST<br>Alive Remote Nodes   : 2<br>VIP up on local node : YES<br>Master Node Name     : pgpool3:5432 Linux proxy3<br>Master Host Name     : pgpool3<br><br>Watchdog Node Information <br>Node Name      : pgpool3:5432 Linux proxy3<br>Host Name      : pgpool3<br>Delegate IP    : 192.168.175.30<br>Pgpool port    : 5432<br>Watchdog port  : 9000<br>Node priority  : 1<br>Status         : 4<br>Status Name    : MASTER<br><br>Node Name      : pgpool1:5432 Linux proxy1<br>Host Name      : pgpool1<br>Delegate IP    : 192.168.175.30<br>Pgpool port    : 5432<br>Watchdog port  : 9000<br>Node priority  : 1<br>Status         : 7<br>Status Name    : STANDBY<br><br>Node Name      : pgpool2:5432 Linux proxy2<br>Host Name      : pgpool2<br>Delegate IP    : 192.168.175.30<br>Pgpool port    : 5432<br>Watchdog port  : 9000<br>Node priority  : 1<br>Status         : 7<br>Status Name    : STANDBY<br><div>=================================== 8&lt; ?============================================<br></div><div><br></div><div>If I stop the primary PostgreSQL server, the maser PgPool node realises this, but it cannot execute the failover because it does not get the consensus from other nodes:</div><div>=================================== 8&lt; ?============================================<br></div>Oct 28 18:47:34 proxy3 pgpool[25364]: [348-1] 2019-10-28 18:47:34: pid 25364: LOG:  failed to connect to PostgreSQL server on &quot;postgres1:5432&quot;, getsockopt() detected error &quot;Connection refused&quot;<br>Oct 28 18:47:34 proxy3 pgpool[25364]: [348-2] 2019-10-28 18:47:34: pid 25364: LOCATION:  pool_connection_pool.c:680<br>Oct 28 18:47:34 proxy3 pgpool[25364]: [349-1] 2019-10-28 18:47:34: pid 25364: ERROR:  failed to make persistent db connection<br>Oct 28 18:47:34 proxy3 pgpool[25364]: [349-2] 2019-10-28 18:47:34: pid 25364: DETAIL:  connection to host:&quot;postgres1:5432&quot; failed<br>Oct 28 18:47:34 proxy3 pgpool[25364]: [349-3] 2019-10-28 18:47:34: pid 25364: LOCATION:  child.c:1328<br>Oct 28 18:47:35 proxy3 pgpool[25036]: [634-1] 2019-10-28 18:47:35: pid 25036: LOG:  failed to connect to PostgreSQL server on &quot;postgres1:5432&quot;, getsockopt() detected error &quot;Connection refused&quot;<br>Oct 28 18:47:35 proxy3 pgpool[25036]: [634-2] 2019-10-28 18:47:35: pid 25036: LOCATION:  pool_connection_pool.c:680<br>Oct 28 18:47:35 proxy3 pgpool[25036]: [635-1] 2019-10-28 18:47:35: pid 25036: ERROR:  failed to make persistent db connection<br>Oct 28 18:47:35 proxy3 pgpool[25036]: [635-2] 2019-10-28 18:47:35: pid 25036: DETAIL:  connection to host:&quot;postgres1:5432&quot; failed<br>Oct 28 18:47:35 proxy3 pgpool[25036]: [635-3] 2019-10-28 18:47:35: pid 25036: LOCATION:  child.c:1328<br>Oct 28 18:47:35 proxy3 pgpool[25036]: [636-1] 2019-10-28 18:47:35: pid 25036: LOG:  health check retrying on DB node: 0 (round:1)<br>Oct 28 18:47:35 proxy3 pgpool[25036]: [636-2] 2019-10-28 18:47:35: pid 25036: LOCATION:  health_check.c:298<br>Oct 28 18:47:36 proxy3 pgpool[25036]: [637-1] 2019-10-28 18:47:36: pid 25036: LOG:  failed to connect to PostgreSQL server on &quot;postgres1:5432&quot;, getsockopt() detected error &quot;Connection refused&quot;<br>Oct 28 18:47:36 proxy3 pgpool[25036]: [637-2] 2019-10-28 18:47:36: pid 25036: LOCATION:  pool_connection_pool.c:680<br>Oct 28 18:47:36 proxy3 pgpool[25036]: [638-1] 2019-10-28 18:47:36: pid 25036: ERROR:  failed to make persistent db connection<br>Oct 28 18:47:36 proxy3 pgpool[25036]: [638-2] 2019-10-28 18:47:36: pid 25036: DETAIL:  connection to host:&quot;postgres1:5432&quot; failed<br>Oct 28 18:47:36 proxy3 pgpool[25036]: [638-3] 2019-10-28 18:47:36: pid 25036: LOCATION:  child.c:1328<br>Oct 28 18:47:36 proxy3 pgpool[25036]: [639-1] 2019-10-28 18:47:36: pid 25036: LOG:  health check retrying on DB node: 0 (round:2)<br>Oct 28 18:47:36 proxy3 pgpool[25036]: [639-2] 2019-10-28 18:47:36: pid 25036: LOCATION:  health_check.c:298<br>Oct 28 18:47:37 proxy3 pgpool[25036]: [640-1] 2019-10-28 18:47:37: pid 25036: LOG:  failed to connect to PostgreSQL server on &quot;postgres1:5432&quot;, getsockopt() detected error &quot;Connection refused&quot;<br>Oct 28 18:47:37 proxy3 pgpool[25036]: [640-2] 2019-10-28 18:47:37: pid 25036: LOCATION:  pool_connection_pool.c:680<br>Oct 28 18:47:37 proxy3 pgpool[25036]: [641-1] 2019-10-28 18:47:37: pid 25036: ERROR:  failed to make persistent db connection<br>Oct 28 18:47:37 proxy3 pgpool[25036]: [641-2] 2019-10-28 18:47:37: pid 25036: DETAIL:  connection to host:&quot;postgres1:5432&quot; failed<br>Oct 28 18:47:37 proxy3 pgpool[25036]: [641-3] 2019-10-28 18:47:37: pid 25036: LOCATION:  child.c:1328<br>Oct 28 18:47:37 proxy3 pgpool[25036]: [642-1] 2019-10-28 18:47:37: pid 25036: LOG:  health check retrying on DB node: 0 (round:3)<br>Oct 28 18:47:37 proxy3 pgpool[25036]: [642-2] 2019-10-28 18:47:37: pid 25036: LOCATION:  health_check.c:298<br>Oct 28 18:47:38 proxy3 pgpool[25036]: [643-1] 2019-10-28 18:47:38: pid 25036: LOG:  failed to connect to PostgreSQL server on &quot;postgres1:5432&quot;, getsockopt() detected error &quot;Connection refused&quot;<br>Oct 28 18:47:38 proxy3 pgpool[25036]: [643-2] 2019-10-28 18:47:38: pid 25036: LOCATION:  pool_connection_pool.c:680<br>Oct 28 18:47:38 proxy3 pgpool[25036]: [644-1] 2019-10-28 18:47:38: pid 25036: ERROR:  failed to make persistent db connection<br>Oct 28 18:47:38 proxy3 pgpool[25036]: [644-2] 2019-10-28 18:47:38: pid 25036: DETAIL:  connection to host:&quot;postgres1:5432&quot; failed<br>Oct 28 18:47:38 proxy3 pgpool[25036]: [644-3] 2019-10-28 18:47:38: pid 25036: LOCATION:  child.c:1328<br>Oct 28 18:47:38 proxy3 pgpool[25036]: [645-1] 2019-10-28 18:47:38: pid 25036: LOG:  health check failed on node 0 (timeout:0)<br>Oct 28 18:47:38 proxy3 pgpool[25036]: [645-2] 2019-10-28 18:47:38: pid 25036: LOCATION:  health_check.c:201<br>Oct 28 18:47:38 proxy3 pgpool[25036]: [646-1] 2019-10-28 18:47:38: pid 25036: LOG:  received degenerate backend request for node_id: 0 from pid [25036]<br>Oct 28 18:47:38 proxy3 pgpool[25036]: [646-2] 2019-10-28 18:47:38: pid 25036: LOCATION:  pgpool_main.c:1125<br>Oct 28 18:47:38 proxy3 pgpool[22900]: [341-1] 2019-10-28 18:47:38: pid 22900: LOG:  new IPC connection received<br>Oct 28 18:47:38 proxy3 pgpool[22900]: [341-2] 2019-10-28 18:47:38: pid 22900: LOCATION:  watchdog.c:3147<br>Oct 28 18:47:38 proxy3 pgpool[22900]: [342-1] 2019-10-28 18:47:38: pid 22900: LOG:  watchdog received the failover command from local pgpool-II on IPC interface<br>Oct 28 18:47:38 proxy3 pgpool[22900]: [342-2] 2019-10-28 18:47:38: pid 22900: LOCATION:  watchdog.c:2570<br>Oct 28 18:47:38 proxy3 pgpool[22900]: [343-1] 2019-10-28 18:47:38: pid 22900: LOG:  watchdog is processing the failover command [DEGENERATE_BACKEND_REQUEST] received from local pgpool-II on IPC interface<br>Oct 28 18:47:38 proxy3 pgpool[22900]: [343-2] 2019-10-28 18:47:38: pid 22900: LOCATION:  watchdog.c:2491<br>Oct 28 18:47:38 proxy3 pgpool[22900]: [344-1] 2019-10-28 18:47:38: pid 22900: LOG:  failover requires the majority vote, waiting for consensus<br>Oct 28 18:47:38 proxy3 pgpool[22900]: [344-2] 2019-10-28 18:47:38: pid 22900: DETAIL:  failover request noted<br>Oct 28 18:47:38 proxy3 pgpool[22900]: [344-3] 2019-10-28 18:47:38: pid 22900: LOCATION:  watchdog.c:2352<br>Oct 28 18:47:38 proxy3 pgpool[22900]: [345-1] 2019-10-28 18:47:38: pid 22900: LOG:  failover command [DEGENERATE_BACKEND_REQUEST] request from pgpool-II node &quot;pgpool3:5432 Linux proxy3&quot; is queued, waiting for the confirmation from other nodes<br>Oct 28 18:47:38 proxy3 pgpool[22900]: [345-2] 2019-10-28 18:47:38: pid 22900: LOCATION:  watchdog.c:2545<br>Oct 28 18:47:38 proxy3 pgpool[25036]: [647-1] 2019-10-28 18:47:38: pid 25036: LOG:  degenerate backend request for node_id: 0 from pid [25036], will be handled by watchdog, which is building consensus for request<br>Oct 28 18:47:38 proxy3 pgpool[25036]: [647-2] 2019-10-28 18:47:38: pid 25036: LOCATION:  pgpool_main.c:1186<br>Oct 28 18:47:44 proxy3 pgpool[25364]: [350-1] 2019-10-28 18:47:44: pid 25364: ERROR:  Failed to check replication time lag<br>Oct 28 18:47:44 proxy3 pgpool[25364]: [350-2] 2019-10-28 18:47:44: pid 25364: DETAIL:  No persistent db connection for the node 0<br>Oct 28 18:47:44 proxy3 pgpool[25364]: [350-3] 2019-10-28 18:47:44: pid 25364: HINT:  check sr_check_user and sr_check_password<br>Oct 28 18:47:44 proxy3 pgpool[25364]: [350-4] 2019-10-28 18:47:44: pid 25364: CONTEXT:  while checking replication time lag<br>Oct 28 18:47:44 proxy3 pgpool[25364]: [350-5] 2019-10-28 18:47:44: pid 25364: LOCATION:  pool_worker_child.c:326<br>Oct 28 18:47:44 proxy3 pgpool[25364]: [351-1] 2019-10-28 18:47:44: pid 25364: LOG:  failed to connect to PostgreSQL server on &quot;postgres1:5432&quot;, getsockopt() detected error &quot;Connection refused&quot;<br>Oct 28 18:47:44 proxy3 pgpool[25364]: [351-2] 2019-10-28 18:47:44: pid 25364: LOCATION:  pool_connection_pool.c:680<br>Oct 28 18:47:44 proxy3 pgpool[25364]: [352-1] 2019-10-28 18:47:44: pid 25364: ERROR:  failed to make persistent db connection<br>Oct 28 18:47:44 proxy3 pgpool[25364]: [352-2] 2019-10-28 18:47:44: pid 25364: DETAIL:  connection to host:&quot;postgres1:5432&quot; failed<br>Oct 28 18:47:44 proxy3 pgpool[25364]: [352-3] 2019-10-28 18:47:44: pid 25364: LOCATION:  child.c:1328<div>[...]<br><div>=================================== 8&lt; ?============================================<br></div><div><br></div><div>Logs are almost the same on other PgPool nodes (proxy1 and proxy2).</div><div>=================================== 8&lt; ?============================================<br></div><div>Oct 28 18:50:23 proxy2 pgpool[11661]: [762-5] 2019-10-28 18:50:23: pid 11661: LOCATION:  pool_worker_child.c:326<br>Oct 28 18:50:23 proxy2 pgpool[11661]: [763-1] 2019-10-28 18:50:23: pid 11661: LOG:  failed to connect to PostgreSQL server on &quot;postgres1:5432&quot;, getsockopt() detected error &quot;Connection refused&quot;<br>Oct 28 18:50:23 proxy2 pgpool[11661]: [763-2] 2019-10-28 18:50:23: pid 11661: LOCATION:  pool_connection_pool.c:680<br>Oct 28 18:50:23 proxy2 pgpool[11661]: [764-1] 2019-10-28 18:50:23: pid 11661: ERROR:  failed to make persistent db connection<br>Oct 28 18:50:23 proxy2 pgpool[11661]: [764-2] 2019-10-28 18:50:23: pid 11661: DETAIL:  connection to host:&quot;postgres1:5432&quot; failed<br>Oct 28 18:50:23 proxy2 pgpool[11661]: [764-3] 2019-10-28 18:50:23: pid 11661: LOCATION:  child.c:1328<br>Oct 28 18:50:30 proxy2 pgpool[10358]: [123-1] 2019-10-28 18:50:30: pid 10358: LOG:  remote node &quot;pgpool3:5432 Linux proxy3&quot; is asking to inform about quarantined backend nodes<br>Oct 28 18:50:30 proxy2 pgpool[10358]: [123-2] 2019-10-28 18:50:30: pid 10358: LOCATION:  watchdog.c:3745<br>Oct 28 18:50:30 proxy2 pgpool[10355]: [717-1] 2019-10-28 18:50:30: pid 10355: LOG:  Pgpool-II parent process received inform quarantine nodes signal from watchdog<br>Oct 28 18:50:30 proxy2 pgpool[10355]: [717-2] 2019-10-28 18:50:30: pid 10355: LOCATION:  pgpool_main.c:1550<br>Oct 28 18:50:33 proxy2 pgpool[11661]: [765-1] 2019-10-28 18:50:33: pid 11661: ERROR:  Failed to check replication time lag<br>Oct 28 18:50:33 proxy2 pgpool[11661]: [765-2] 2019-10-28 18:50:33: pid 11661: DETAIL:  No persistent db connection for the node 0<br>Oct 28 18:50:33 proxy2 pgpool[11661]: [765-3] 2019-10-28 18:50:33: pid 11661: HINT:  check sr_check_user and sr_check_password<br>Oct 28 18:50:33 proxy2 pgpool[11661]: [765-4] 2019-10-28 18:50:33: pid 11661: CONTEXT:  while checking replication time lag<br>Oct 28 18:50:33 proxy2 pgpool[11661]: [765-5] 2019-10-28 18:50:33: pid 11661: LOCATION:  pool_worker_child.c:326<br>Oct 28 18:50:33 proxy2 pgpool[11661]: [766-1] 2019-10-28 18:50:33: pid 11661: LOG:  failed to connect to PostgreSQL server on &quot;postgres1:5432&quot;, getsockopt() detected error &quot;Connection refused&quot;<br>Oct 28 18:50:33 proxy2 pgpool[11661]: [766-2] 2019-10-28 18:50:33: pid 11661: LOCATION:  pool_connection_pool.c:680<br></div></div><div>=================================== 8&lt; ?============================================<br></div><div><br></div><div>Pool nodes status during the failover try:</div><div>=================================== 8&lt; ?============================================<br></div><div>postgres@proxy3:~$ psql -h 127.0.0.1 -p 5432 -U repmgr -c &quot;show pool_nodes;&quot;<br>psql: FATAL:  failed to create a backend 0 connection<br>DETAIL:  not executing failover because failover_on_backend_error is off<br></div><div>=================================== 8&lt; ?============================================<br></div><div><br></div><div>This is the failover configuration on PgPool nodes:</div><div>=================================== 8&lt; ?============================================<br></div><div>#------------------------------------------------------------------------------<br># FAILOVER AND FAILBACK<br>#------------------------------------------------------------------------------<br><br>failover_command = &#39;/usr/local/bin/pgpool-failover.sh %d %h %P %m %H %R&#39;<br>failback_command = &#39;echo failback %d %h %p %D %m %H %M %P&#39;<br>failover_on_backend_error = off<br>detach_false_primary = off<br>search_primary_node_timeout = 300<br></div><div>=================================== 8&lt; ?============================================<br></div><div><br></div><div>And this is the health check configuration on PgPool nodes:</div><div>=================================== 8&lt; ?============================================<br></div><div>#------------------------------------------------------------------------------<br># HEALTH CHECK GLOBAL PARAMETERS<br>#------------------------------------------------------------------------------<br><br>health_check_period = 40<br>health_check_timeout = 10<br>health_check_user = &#39;hc&#39;<br>health_check_password = &#39;password&#39;<br>health_check_database = &#39;postgres&#39;<br>health_check_max_retries = 3<br>health_check_retry_delay = 1<br>connect_timeout = 10000<br></div><div>=================================== 8&lt; ?============================================<br></div><div><br></div><div>Could you help me please?</div><div>Thank you very much!</div><div>Bye</div><div><br></div></div>