<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:&quot;courier new&quot;,monospace">I&#39;m running 4 app (pgpool) nodes (3.6.10) and 2 db (postgres) nodes (9.6.9) primary/standby configuration with streaming replication. All 6 nodes are separate machines. </div><div class="gmail_default" style="font-family:&quot;courier new&quot;,monospace"><br></div><div class="gmail_default" style="font-family:&quot;courier new&quot;,monospace">A client has had too many failovers caused by the flaky network and in an effort to remedy the issue I set the following parameters</div><div class="gmail_default" style="font-family:&quot;courier new&quot;,monospace"><br></div><div class="gmail_default"><div class="gmail_default" style="font-family:&quot;courier new&quot;,monospace">health_check_max_retries = 7</div><div class="gmail_default" style="font-family:&quot;courier new&quot;,monospace">health_check_retry_delay = 15<br></div><div class="gmail_default" style="font-family:&quot;courier new&quot;,monospace"><br></div><div class="gmail_default" style="font-family:&quot;courier new&quot;,monospace">Now, I have the client&#39;s environment and a lab environment to reproduce the issue. Pgpool configuration and the version are identical.</div><div class="gmail_default" style="font-family:&quot;courier new&quot;,monospace"><br></div><div class="gmail_default" style="font-family:&quot;courier new&quot;,monospace">To simulate a flaky network, I use iptables to deny postgres connections to one of the db nodes and see that pgpool on all app nodes is trying to reconnect according to the configured number of retries and retry delay, </div><blockquote class="gmail_quote" style="font-family:&quot;courier new&quot;,monospace;margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">i.e.<br>2019-02-11 14:22:51: pid 7825: LOG:  failed to connect to PostgreSQL server on &quot;<a href="http://10.0.10.133:5433">10.0.10.133:5433</a>&quot;, getsockopt() detected error &quot;No route to host&quot;<br>...<br>2019-02-11 14:23:23: pid 6458: LOG:  health checking retry count 1 <br>...<br>2019-02-11 14:23:38: pid 6458: LOG:  health checking retry count 2 <br>...<br>2019-02-11 14:42:45: pid 6458: LOG:  health checking retry count 3 <br>...<br>2019-02-11 14:43:00: pid 6458: LOG:  health checking retry count 4 <br>...<br>2019-02-11 14:43:15: pid 6458: LOG:  health checking retry count 5 <br>...<br>2019-02-11 14:43:30: pid 6458: LOG:  health checking retry count 6 <br>...<br>2019-02-11 14:43:30: pid 6460: LOG:  failover request from local pgpool-II node received on IPC interface is forwarded to master watchdog node &quot;<a href="http://172.20.20.173:5432">172.20.20.173:5432</a>&quot;<br>2019-02-11 14:43:30: pid 4565: LOG:  watchdog received the failover command from remote pgpool-II node &quot;<a href="http://172.20.20.172:5432">172.20.20.172:5432</a>&quot;<br>...<br>2019-02-11 14:43:30: pid 4563: LOG:  execute command: /etc/pgpool-II/failover.sh 0 10.0.10.133 5433 /opt/redsky/db/data 1 0 10.0.10.134 1 5433 /opt/redsky/db/data<br><br></blockquote><div class="gmail_default" style="font-family:&quot;courier new&quot;,monospace">However, in the client&#39;s environment failover gets initiated before the configured number of retries, i.e.</div><div class="gmail_default" style="font-family:&quot;courier new&quot;,monospace"><br></div><div class="gmail_default"><blockquote class="gmail_quote" style="font-family:&quot;courier new&quot;,monospace;margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">2019-02-09 05:17:47: pid 19402: LOG:  watchdog received the failover command from local pgpool-II on IPC interface<br>2019-02-09 05:17:47: pid 19402: LOG:  watchdog is processing the failover command [DEGENERATE_BACKEND_REQUEST] received from local pgpool-II on IPC interface<br>2019-02-09 05:17:47: pid 19402: LOG:  forwarding the failover request [DEGENERATE_BACKEND_REQUEST] to all alive nodes<br>2019-02-09 05:17:47: pid 19402: DETAIL:  watchdog cluster currently has 3 connected remote nodes<br>2019-02-09 05:17:47: pid 19276: ERROR:  unable to read data from DB node 1<br>2019-02-09 05:17:47: pid 19276: DETAIL:  socket read failed with an error &quot;Success&quot;<br>2019-02-09 05:17:47: pid 19400: LOG:  Pgpool-II parent process has received failover request<br>2019-02-09 05:17:47: pid 19402: LOG:  new IPC connection received<br>2019-02-09 05:17:47: pid 19402: LOG:  received the failover command lock request from local pgpool-II on IPC interface<br>2019-02-09 05:17:47: pid 19402: LOG:  local pgpool-II node &quot;<a href="http://10.15.35.35:5432">10.15.35.35:5432</a>&quot; is requesting to become a lock holder for failover ID: 19880<br>2019-02-09 05:17:47: pid 19402: LOG:  local pgpool-II node &quot;<a href="http://10.15.35.35:5432">10.15.35.35:5432</a>&quot; is the lock holder<br>2019-02-09 05:17:47: pid 19400: LOG:  starting degeneration. shutdown host 10.38.135.137(5433)<br>2019-02-09 05:17:47: pid 19400: LOG:  Restart all children<br>2019-02-09 05:17:47: pid 19400: LOG:  execute command: /etc/pgpool-II/failover.sh 1 10.38.135.137 5433 /opt/redsky/db/data 0 0 10.15.35.39 1 5433 /opt/redsky/db/data<br><br></blockquote><div style="font-family:&quot;courier new&quot;,monospace"><br></div><div><div class="gmail_default"><div style="font-family:&quot;courier new&quot;,monospace">I ran the following command on all app nodes </div><div style="font-family:&quot;courier new&quot;,monospace"><br></div><div style="font-family:Arial,Helvetica,sans-serif"><font face="courier new, monospace">psql -c &#39;pgpool show health_check_max_retries&#39;</font></div><div style="font-family:Arial,Helvetica,sans-serif"><font face="courier new, monospace">health_check_max_retries</font></div><div style="font-family:Arial,Helvetica,sans-serif"><font face="courier new, monospace">--------------------------</font></div><div style="font-family:Arial,Helvetica,sans-serif"><font face="courier new, monospace">16</font></div><div style="font-family:Arial,Helvetica,sans-serif"><font face="courier new, monospace">(1 row) </font></div><div style="font-family:Arial,Helvetica,sans-serif"><font face="courier new, monospace"><br></font></div><div style="font-family:Arial,Helvetica,sans-serif"><font face="courier new, monospace">and the number is different from what I have in the configuration file.. It&#39;s more than 1 though and I expect it to be honored. </font></div><div style="font-family:Arial,Helvetica,sans-serif"><font face="courier new, monospace"><br></font></div><div style="font-family:Arial,Helvetica,sans-serif"><font face="courier new, monospace">Can you guys help me out? </font><span style="font-family:&quot;courier new&quot;,monospace">I&#39;m out of ideas..</span></div><div style="font-family:Arial,Helvetica,sans-serif"><span style="font-family:&quot;courier new&quot;,monospace"><br></span></div><div><font face="courier new, monospace">pgpool-II-pg96-3.6.10-1pgdg.rhel6.x86_64</font><br></div></div></div></div></div></div></div></div></div></div></div></div>