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