<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">Any idea why pgpool doesn't retry?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Feb 17, 2019 at 6:19 PM Bo Peng <<a href="mailto:pengbo@sraoss.co.jp">pengbo@sraoss.co.jp</a>> 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>
I confirmed your pgpool.conf, you set <br>
<br>
  health_check_max_retries = 16<br>
<br>
So I think the following result is correct. <br>
<br>
> >> > psql -c 'pgpool show health_check_max_retries'<br>
> >> > health_check_max_retries<br>
> >> > --------------------------<br>
> >> > 16<br>
> >> > (1 row)<br>
<br>
On Fri, 15 Feb 2019 07:12:56 -0500<br>
Alexander Dorogensky <<a href="mailto:amazinglifetime@gmail.com" target="_blank">amazinglifetime@gmail.com</a>> wrote:<br>
<br>
> Hi,<br>
> <br>
> Do you have any ideas what’s going on?<br>
> <br>
> On Mon, Feb 11, 2019 at 8:30 PM Alexander Dorogensky <<br>
> <a href="mailto:amazinglifetime@gmail.com" target="_blank">amazinglifetime@gmail.com</a>> wrote:<br>
> <br>
> > Pgpool.conf from one of the app nodes is attached<br>
> ><br>
> > Thanks<br>
> ><br>
> > On Mon, Feb 11, 2019 at 6:59 PM Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>> wrote:<br>
> ><br>
> >> Hi,<br>
> >><br>
> >> On Mon, 11 Feb 2019 15:32:55 -0600<br>
> >> Alexander Dorogensky <<a href="mailto:amazinglifetime@gmail.com" target="_blank">amazinglifetime@gmail.com</a>> wrote:<br>
> >><br>
> >> > I'm running 4 app (pgpool) nodes (3.6.10) and 2 db (postgres) nodes<br>
> >> (9.6.9)<br>
> >> > primary/standby configuration with streaming replication. All 6 nodes<br>
> >> are<br>
> >> > separate machines.<br>
> >> ><br>
> >> > A client has had too many failovers caused by the flaky network and in<br>
> >> an<br>
> >> > effort to remedy the issue I set the following parameters<br>
> >> ><br>
> >> > health_check_max_retries = 7<br>
> >> > health_check_retry_delay = 15<br>
> >> ><br>
> >> > Now, I have the client's environment and a lab environment to reproduce<br>
> >> the<br>
> >> > issue. Pgpool configuration and the version are identical.<br>
> >> ><br>
> >> > To simulate a flaky network, I use iptables to deny postgres<br>
> >> connections to<br>
> >> > one of the db nodes and see that pgpool on all app nodes is trying to<br>
> >> > reconnect according to the configured number of retries and retry delay,<br>
> >> ><br>
> >> > > i.e.<br>
> >> > > 2019-02-11 14:22:51: pid 7825: LOG:  failed to connect to PostgreSQL<br>
> >> > > server on "<a href="http://10.0.10.133:5433" rel="noreferrer" target="_blank">10.0.10.133:5433</a>", getsockopt() detected error "No route<br>
> >> to<br>
> >> > > host"<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<br>
> >> pgpool-II<br>
> >> > > node received on IPC interface is forwarded to master watchdog node "<br>
> >> > > <a href="http://172.20.20.173:5432" rel="noreferrer" target="_blank">172.20.20.173:5432</a>"<br>
> >> > > 2019-02-11 14:43:30: pid 4565: LOG:  watchdog received the failover<br>
> >> > > command from remote pgpool-II node "<a href="http://172.20.20.172:5432" rel="noreferrer" target="_blank">172.20.20.172:5432</a>"<br>
> >> > > ...<br>
> >> > > 2019-02-11 14:43:30: pid 4563: LOG:  execute command:<br>
> >> > > /etc/pgpool-II/failover.sh 0 10.0.10.133 5433 /opt/redsky/db/data 1 0<br>
> >> > > 10.0.10.134 1 5433 /opt/redsky/db/data<br>
> >> > ><br>
> >> > > However, in the client's environment failover gets initiated before<br>
> >> the<br>
> >> > configured number of retries, i.e.<br>
> >> ><br>
> >> > 2019-02-09 05:17:47: pid 19402: LOG:  watchdog received the failover<br>
> >> > > command from local pgpool-II on IPC interface<br>
> >> > > 2019-02-09 05:17:47: pid 19402: LOG:  watchdog is processing the<br>
> >> failover<br>
> >> > > command [DEGENERATE_BACKEND_REQUEST] received from local pgpool-II on<br>
> >> IPC<br>
> >> > > interface<br>
> >> > > 2019-02-09 05:17:47: pid 19402: LOG:  forwarding the failover request<br>
> >> > > [DEGENERATE_BACKEND_REQUEST] to all alive nodes<br>
> >> > > 2019-02-09 05:17:47: pid 19402: DETAIL:  watchdog cluster currently<br>
> >> has 3<br>
> >> > > connected remote nodes<br>
> >> > > 2019-02-09 05:17:47: pid 19276: ERROR:  unable to read data from DB<br>
> >> node 1<br>
> >> > > 2019-02-09 05:17:47: pid 19276: DETAIL:  socket read failed with an<br>
> >> error<br>
> >> > > "Success"<br>
> >> > > 2019-02-09 05:17:47: pid 19400: LOG:  Pgpool-II parent process has<br>
> >> > > 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<br>
> >> lock<br>
> >> > > request from local pgpool-II on IPC interface<br>
> >> > > 2019-02-09 05:17:47: pid 19402: LOG:  local pgpool-II node "<br>
> >> > > <a href="http://10.15.35.35:5432" rel="noreferrer" target="_blank">10.15.35.35:5432</a>" is requesting to become a lock holder for failover<br>
> >> ID:<br>
> >> > > 19880<br>
> >> > > 2019-02-09 05:17:47: pid 19402: LOG:  local pgpool-II node "<br>
> >> > > <a href="http://10.15.35.35:5432" rel="noreferrer" target="_blank">10.15.35.35:5432</a>" is the lock holder<br>
> >> > > 2019-02-09 05:17:47: pid 19400: LOG:  starting degeneration. shutdown<br>
> >> host<br>
> >> > > 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:<br>
> >> > > /etc/pgpool-II/failover.sh 1 10.38.135.137 5433 /opt/redsky/db/data 0<br>
> >> 0<br>
> >> > > 10.15.35.39 1 5433 /opt/redsky/db/data<br>
> >> > ><br>
> >> > ><br>
> >> > I ran the following command on all app nodes<br>
> >> ><br>
> >> > psql -c 'pgpool show health_check_max_retries'<br>
> >> > health_check_max_retries<br>
> >> > --------------------------<br>
> >> > 16<br>
> >> > (1 row)<br>
> >> ><br>
> >> > and the number is different from what I have in the configuration file..<br>
> >> > It'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>
> >> > Can you guys help me out? I'm out of ideas..<br>
> >> ><br>
> >> > pgpool-II-pg96-3.6.10-1pgdg.rhel6.x86_64<br>
> >><br>
> >><br>
> >> --<br>
> >> Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>><br>
> >> SRA OSS, Inc. Japan<br>
> >><br>
> >><br>
<br>
<br>
-- <br>
Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>><br>
SRA OSS, Inc. Japan<br>
<br>
</blockquote></div>