<div dir="ltr">Hi Ishii-San<div><br></div><div>I have tried to rephrase your suggestion for clarity. Please have a look at the attached patch if you see it fit</div><div><br></div><div><br></div><div>Thanks</div><div>Best Regards</div><div>Muhammad Usama</div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 11, 2018 at 1:30 PM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok, here is a proposal for addition to the doc.<br>
<div class="HOEnZb"><div class="h5"><br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
<br>
&gt; Usama,<br>
&gt; <br>
&gt; Do we want to add some notes to the doc regarding this? The behavior<br>
&gt; described below may not be obvious to users.<br>
&gt; <br>
&gt; Best regards,<br>
&gt; --<br>
&gt; Tatsuo Ishii<br>
&gt; SRA OSS, Inc. Japan<br>
&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
&gt; <br>
&gt;&gt; Hi<br>
&gt;&gt; <br>
&gt;&gt; Thanks for the logs and config files.<br>
&gt;&gt; As per the logs and pgpool.conf files, This is what is happening.<br>
&gt;&gt; <br>
&gt;&gt; You have health check disabled on all Pgpool-II nodes, So only way to<br>
&gt;&gt; detect the backend failure is through fail_over_on_backend error( which<br>
&gt;&gt; only works when client connection<br>
&gt;&gt; detects the error) . But since the clients are only connecting to the<br>
&gt;&gt; master Pgpool-II node, so only master Pgpool-II node can notice the backend<br>
&gt;&gt; PostgreSQL node failure<br>
&gt;&gt; and because of consensus requirement it will keep waiting for the detection<br>
&gt;&gt; of backend failure by other Pgpool-II nodes, Which never arrives because<br>
&gt;&gt; other two Pgpool-II nodes<br>
&gt;&gt; are sitting idle and didn&#39;t detected the error.<br>
&gt;&gt; So you either need to enable the health check on all pgpool-II nodes (<br>
&gt;&gt; Which is the recommended setting for HA) or just disable the consensus<br>
&gt;&gt; requirements (as you did when failover<br>
&gt;&gt; was working fine)<br>
&gt;&gt; <br>
&gt;&gt; Thanks<br>
&gt;&gt; Best Rgeards<br>
&gt;&gt; Muhammad Usama<br>
&gt;&gt; <br>
&gt;&gt; On Tue, May 8, 2018 at 7:54 PM, Vlad G &lt;<a href="mailto:omenvlad@gmail.com">omenvlad@gmail.com</a>&gt; wrote:<br>
&gt;&gt; <br>
&gt;&gt;&gt; Hey Guys.<br>
&gt;&gt;&gt; Thank you for your answer.<br>
&gt;&gt;&gt; I attached the configuration files of pgpool and logs.<br>
&gt;&gt;&gt; I hope you сan help.<br>
&gt;&gt;&gt;<br>
&gt;&gt; <br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Best regards,<br>
&gt;&gt;&gt; Vladyslav<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On May 7, 2018, at 16:05, Muhammad Usama &lt;<a href="mailto:m.usama@gmail.com">m.usama@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hi<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; From the log snippet you shared it seems that the the failure was never<br>
&gt;&gt;&gt; detected by the other Pgpool-II node, Can you please share the pgpoo.conf<br>
&gt;&gt;&gt; files and log files for all Pgpool nodes.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks<br>
&gt;&gt;&gt; Best Regards<br>
&gt;&gt;&gt; Muhammad Usama<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Thu, May 3, 2018 at 5:20 PM, Vlad G &lt;<a href="mailto:omenvlad@gmail.com">omenvlad@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Hey Guys,<br>
&gt;&gt;&gt;&gt; I have a cluster with Pgpool-II-pg96-3.7.3 and postgresql-9.6.<br>
&gt;&gt;&gt;&gt; (3 x pgpool and 3 x postgresql<br>
&gt;&gt;&gt;&gt; The same scheme as:<br>
&gt;&gt;&gt;&gt; <a href="http://www.pgpool.net/docs/latest/en/html/example-cluster.html" rel="noreferrer" target="_blank">http://www.pgpool.net/docs/<wbr>latest/en/html/example-<wbr>cluster.html</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; When master node of postgresql (pgpoolpsql-1) goes down the master node<br>
&gt;&gt;&gt;&gt; of pgpool (  pgpool-1)  does not get second vote from one of the standby<br>
&gt;&gt;&gt;&gt; pgpool nodes (pgpool-2 and pgpool-3).<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; If I set:<br>
&gt;&gt;&gt;&gt; failover_require_consensus = off<br>
&gt;&gt;&gt;&gt; Everything works fine.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; May 03 13:02:45 pgpool-1 pgpool[24216]: 2018-05-03 13:02:45: pid 24237:<br>
&gt;&gt;&gt;&gt; LOG:  failed to connect to PostgreSQL server on &quot;pgpoolpsql-1:5432&quot;,<br>
&gt;&gt;&gt;&gt; getsockopt() detected error &quot;Connection refused&quot;<br>
&gt;&gt;&gt;&gt; May 03 13:02:45 pgpool-1 pgpool[24216]: 2018-05-03 13:02:45: pid 24237:<br>
&gt;&gt;&gt;&gt; LOG:  received degenerate backend request for node_id: 0 from pid [24237]<br>
&gt;&gt;&gt;&gt; May 03 13:02:45 pgpool-1 pgpool[24216]: 2018-05-03 13:02:45: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  new IPC connection received<br>
&gt;&gt;&gt;&gt; May 03 13:02:45 pgpool-1 pgpool[24216]: 2018-05-03 13:02:45: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  watchdog received the failover command from local pgpool-II on IPC<br>
&gt;&gt;&gt;&gt; interface<br>
&gt;&gt;&gt;&gt; May 03 13:02:45 pgpool-1 pgpool[24216]: 2018-05-03 13:02:45: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  watchdog is processing the failover command<br>
&gt;&gt;&gt;&gt; [DEGENERATE_BACKEND_REQUEST] received from local pgpool-II on IPC interface<br>
&gt;&gt;&gt;&gt; May 03 13:02:45 pgpool-1 pgpool[24216]: 2018-05-03 13:02:45: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  failover requires the majority vote, waiting for consensus<br>
&gt;&gt;&gt;&gt; May 03 13:02:45 pgpool-1 pgpool[24216]: 2018-05-03 13:02:45: pid 24217:<br>
&gt;&gt;&gt;&gt; DETAIL:  failover request noted<br>
&gt;&gt;&gt;&gt; May 03 13:02:45 pgpool-1 pgpool[24216]: 2018-05-03 13:02:45: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  failover command [DEGENERATE_BACKEND_REQUEST] request from pgpool-II<br>
&gt;&gt;&gt;&gt; node &quot;pgpool-1:9999 Linux pgpool-1&quot; is queued, waiting for the confirmation<br>
&gt;&gt;&gt;&gt; from other nodes<br>
&gt;&gt;&gt;&gt; May 03 13:02:45 pgpool-1 pgpool[24216]: 2018-05-03 13:02:45: pid 24237:<br>
&gt;&gt;&gt;&gt; LOG:  degenerate backend request for node_id: 0 from pid [24237], will be<br>
&gt;&gt;&gt;&gt; handled by watchdog, which is building consensus for request<br>
&gt;&gt;&gt;&gt; May 03 13:02:45 pgpool-1 pgpool[24216]: 2018-05-03 13:02:45: pid 24237:<br>
&gt;&gt;&gt;&gt; FATAL:  failed to create a backend connection<br>
&gt;&gt;&gt;&gt; May 03 13:02:45 pgpool-1 pgpool[24216]: 2018-05-03 13:02:45: pid 24237:<br>
&gt;&gt;&gt;&gt; DETAIL:  executing failover on backend<br>
&gt;&gt;&gt;&gt; May 03 13:02:45 pgpool-1 pgpool[24216]: 2018-05-03 13:02:45: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  child process with pid: 24237 exits with status 256<br>
&gt;&gt;&gt;&gt; May 03 13:02:45 pgpool-1 pgpool[24216]: 2018-05-03 13:02:45: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  fork a new child process with pid: 24268<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24228:<br>
&gt;&gt;&gt;&gt; LOG:  failed to connect to PostgreSQL server on &quot;pgpoolpsql-1:5432&quot;,<br>
&gt;&gt;&gt;&gt; getsockopt() detected error &quot;Connection refused&quot;<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24228:<br>
&gt;&gt;&gt;&gt; LOG:  received degenerate backend request for node_id: 0 from pid [24228]<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  new IPC connection received<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  watchdog received the failover command from local pgpool-II on IPC<br>
&gt;&gt;&gt;&gt; interface<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  watchdog is processing the failover command<br>
&gt;&gt;&gt;&gt; [DEGENERATE_BACKEND_REQUEST] received from local pgpool-II on IPC interface<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  Duplicate failover request from &quot;pgpool-1:9999 Linux pgpool-1&quot; node<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24217:<br>
&gt;&gt;&gt;&gt; DETAIL:  request ignored<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  failover requires the majority vote, waiting for consensus<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24217:<br>
&gt;&gt;&gt;&gt; DETAIL:  failover request noted<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24228:<br>
&gt;&gt;&gt;&gt; LOG:  degenerate backend request for 1 node(s) from pid [24228], is changed<br>
&gt;&gt;&gt;&gt; to quarantine node request by watchdog<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24228:<br>
&gt;&gt;&gt;&gt; DETAIL:  watchdog is taking time to build consensus<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24228:<br>
&gt;&gt;&gt;&gt; FATAL:  failed to create a backend connection<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24228:<br>
&gt;&gt;&gt;&gt; DETAIL:  executing failover on backend<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  Pgpool-II parent process has received failover request<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  new IPC connection received<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  received the failover indication from Pgpool-II on IPC interface<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  watchdog is informed of failover end by the main process<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  starting quarantine. shutdown host pgpoolpsql-1(5432)<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  Restart all children<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  failover: set new primary node: -1<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  failover: set new master node: 1<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24252:<br>
&gt;&gt;&gt;&gt; LOG:  worker process received restart request<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  new IPC connection received<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  received the failover indication from Pgpool-II on IPC interface<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: 2018-05-03 13:02:46: pid 24217:<br>
&gt;&gt;&gt;&gt; LOG:  watchdog is informed of failover start by the main process<br>
&gt;&gt;&gt;&gt; May 03 13:02:46 pgpool-1 pgpool[24216]: quarantine done. shutdown host<br>
&gt;&gt;&gt;&gt; pgpoolpsql-1(5432)2018-05-03 13:02:46: pid 24216: LOG:  quarantine done.<br>
&gt;&gt;&gt;&gt; shutdown host pgpoolpsql-1(5432)<br>
&gt;&gt;&gt;&gt; May 03 13:02:47 pgpool-1 pgpool[24216]: 2018-05-03 13:02:47: pid 24251:<br>
&gt;&gt;&gt;&gt; LOG:  restart request received in pcp child process<br>
&gt;&gt;&gt;&gt; May 03 13:02:47 pgpool-1 pgpool[24216]: 2018-05-03 13:02:47: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  PCP child 24251 exits with status 0 in failover()<br>
&gt;&gt;&gt;&gt; May 03 13:02:47 pgpool-1 pgpool[24216]: 2018-05-03 13:02:47: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  fork a new PCP child pid 24301 in failover()<br>
&gt;&gt;&gt;&gt; May 03 13:02:47 pgpool-1 pgpool[24216]: 2018-05-03 13:02:47: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  child process with pid: 24219 exits with status 0<br>
&gt;&gt;&gt;&gt; May 03 13:02:47 pgpool-1 pgpool[24216]: 2018-05-03 13:02:47: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  child process with pid: 24219 exited with success and will not be<br>
&gt;&gt;&gt;&gt; restarted<br>
&gt;&gt;&gt;&gt; May 03 13:02:47 pgpool-1 pgpool[24216]: 2018-05-03 13:02:47: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  child process with pid: 24220 exits with status 0<br>
&gt;&gt;&gt;&gt; May 03 13:02:47 pgpool-1 pgpool[24216]: 2018-05-03 13:02:47: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  child process with pid: 24220 exited with success and will not be<br>
&gt;&gt;&gt;&gt; restarted<br>
&gt;&gt;&gt;&gt; May 03 13:02:47 pgpool-1 pgpool[24216]: 2018-05-03 13:02:47: pid 24216:<br>
&gt;&gt;&gt;&gt; LOG:  child process with pid: 24221 exits with status 0<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Around a month ago it woked fine (It seems I tested it on pgpool-3.7.2),<br>
&gt;&gt;&gt;&gt; but now it does not work. Could you tell me some parameters what it depends<br>
&gt;&gt;&gt;&gt; on or you have other thoughts.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Best regards,<br>
&gt;&gt;&gt;&gt; Vladyslav<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt;&gt; pgpool-general mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
&gt;&gt;&gt;&gt; <a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/<wbr>listinfo/pgpool-general</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt; pgpool-general mailing list<br>
&gt;&gt;&gt; <a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
&gt;&gt;&gt; <a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/<wbr>listinfo/pgpool-general</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; pgpool-general mailing list<br>
&gt; <a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
&gt; <a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/<wbr>listinfo/pgpool-general</a><br>
</div></div><br>diff --git a/doc/src/sgml/watchdog.sgml b/doc/src/sgml/watchdog.sgml<br>
index 7e7adc9..041686b 100644<br>
--- a/doc/src/sgml/watchdog.sgml<br>
+++ b/doc/src/sgml/watchdog.sgml<br>
@@ -442,6 +442,16 @@<br>
         &lt;para&gt;<br>
           Default is on.<br>
         &lt;/para&gt;<br>
+<br>
+       &lt;caution&gt;<br>
+         &lt;para&gt;<br>
+           To make &lt;varname&gt;failover_require_<wbr>consensus&lt;/varname&gt;<br>
+           workable, You need to enable health check. For more<br>
+           details of health check,<br>
+           see &lt;xref linkend=&quot;runtime-config-<wbr>health-check&quot;&gt;.<br>
+         &lt;/para&gt;<br>
+       &lt;/caution&gt;<br>
+<br>
         &lt;para&gt;<br>
         &lt;varname&gt;failover_require_<wbr>consensus&lt;/varname&gt; is not available prior to<br>
         &lt;productname&gt;Pgpool-II &lt;/productname&gt;&lt;emphasis&gt;V3.7&lt;/<wbr>emphasis&gt;. and it is only<br>
<br></blockquote></div><br></div></div></div>