<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 16, 2019 at 12:14 PM Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@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">&gt; On Tue, Apr 16, 2019 at 7:55 AM Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt; wrote:<br>
&gt; <br>
&gt;&gt; Hi Usama,<br>
&gt;&gt;<br>
&gt;&gt; &gt; Hi  TAKATSUKA Haruka,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks for the patch, But your patch effectively disables the node<br>
&gt;&gt; &gt; quarantine, which does&#39;t seems a right way.<br>
&gt;&gt; &gt; Since the backend node that was quarantined because of absence of quorum<br>
&gt;&gt; &gt; and/or consensus is already un-reachable<br>
&gt;&gt; &gt; form the Pgpool-II node, and we don&#39;t want to select it as load-balance<br>
&gt;&gt; &gt; node ( in case the node was secondary) or consider it<br>
&gt;&gt; &gt; as available when it is not by not marking it as quarantine.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; In my opinion the right way to tackle the issue is  by keep setting the<br>
&gt;&gt; &gt; quarantine state as it is done currently  but<br>
&gt;&gt; &gt; also keep the health check working on quarantine nodes. So that as soon<br>
&gt;&gt; as<br>
&gt;&gt; &gt; the connectivity to the<br>
&gt;&gt; &gt; quarantined node resumes, it becomes the part of cluster automatically.<br>
&gt;&gt;<br>
&gt;&gt; What if the connection failure between the primary PostgreSQL and one<br>
&gt;&gt; of Pgpool-II servers is permanent? Doesn&#39;t health checking continues<br>
&gt;&gt; forever?<br>
&gt;&gt;<br>
&gt; <br>
&gt; Yes, only for the quarantined PostgreSQL nodes. But I don&#39;t think there is<br>
&gt; a problem<br>
&gt; in that. As conceptually the quarantine nodes are not failed node (they are<br>
&gt; just unusable at that moment)<br>
&gt; and taking the node out of quarantine zone shouldn&#39;t require the manual<br>
&gt; intervention. So I think its the correct<br>
&gt; way to continue the health checking on quarantined nodes.<br>
&gt; <br>
&gt; Do you see an issue with the approach ?<br>
<br>
Yes. Think about the case when the PostgreSQL node is primary. Users<br>
cannot issue write queries while the retrying. The network failure<br>
could persist days and the whole database cluster is unusable in the<br>
period.<br></blockquote><div><br></div><div>Yes thats true, But not allowing the node to go into quarantine state will still not solve it,</div><div>Because the primary would still be unavailable anyway even if we set the quarantine state</div><div>or not. So whole idea of this patch is to recover from quarantine state automatically as soon as</div><div>the connectivity resumes.</div><div>Similarly failover of that node is again not an option if the user wants to do failover only when the</div><div>network consensus exists, otherwise he should just disable failover_require_consensus.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
BTW,<br>
<br>
&gt; &gt; When the communication between master/coordinator pgpool and<br>
&gt; &gt; primary PostgreSQL node is down during a short period<br>
&gt;<br>
&gt; I wonder why you don&#39;t set appropriate health check retry parameters<br>
&gt; to avoid such a temporary communication failure in the firs place. A<br>
&gt; brain surgery to ignore the error reports from Pgpool-II does not seem<br>
&gt; to be a sane choice.<br>
<br>
The original reporter didn&#39;t answer my question. I think it is likely<br>
a problem of misconfiguraton (should use longer heath check retry).<br>
<br>
In summary I think for shorter period communication failure just<br>
increasing health check parameters is enough. However for longer<br>
period communication failure, the watchdog node should decline the<br>
role.<br></blockquote><div><br></div><div>I am sorry I didn&#39;t totally get it what you mean here.</div><div>Do you mean that the pgpool-II node that has the primary node in quarantine state should resign from the master/coordinator</div><div>pgpool-II node (if it was a master/coordinator) in that case?</div><div> </div><div>Thanks</div><div>Best Regards</div><div>Muhammad Usama</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
&gt;&gt; &gt; Can you please try out the attached patch, to see if the solution works<br>
&gt;&gt; for<br>
&gt;&gt; &gt; the situation?<br>
&gt;&gt; &gt; The patch is generated against current master branch.<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 Wed, Apr 10, 2019 at 2:04 PM TAKATSUKA Haruka &lt;<a href="mailto:harukat@sraoss.co.jp" target="_blank">harukat@sraoss.co.jp</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; Hello, Pgpool developers<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I found Pgpool-II watchdog is too strict for duplicate failover request<br>
&gt;&gt; &gt;&gt; with allow_multiple_failover_requests_from_node=off setting.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; For example, A watchdog cluster with 3 pgpool instances is here.<br>
&gt;&gt; &gt;&gt; Their backends are PostgreSQL servers using streaming replication.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; When the communication between master/coordinator pgpool and<br>
&gt;&gt; &gt;&gt; primary PostgreSQL node is down during a short period<br>
&gt;&gt; &gt;&gt; (or pgpool do any false-positive judgement by various reasons),<br>
&gt;&gt; &gt;&gt; and then the pgpool tries to failover but cannot get the consensus,<br>
&gt;&gt; &gt;&gt; so it makes the primary node into quarantine status. It cannot<br>
&gt;&gt; &gt;&gt; be reset automatically. As a result, the service becomes unavailable.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; This case generates logs like the following:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; pid 1234: LOG:  new IPC connection received<br>
&gt;&gt; &gt;&gt; pid 1234: LOG:  watchdog received the failover command from local<br>
&gt;&gt; &gt;&gt; pgpool-II on IPC interface<br>
&gt;&gt; &gt;&gt; pid 1234: LOG:  watchdog is processing the failover command<br>
&gt;&gt; &gt;&gt; [DEGENERATE_BACKEND_REQUEST] received from local pgpool-II on IPC<br>
&gt;&gt; interface<br>
&gt;&gt; &gt;&gt; pid 1234: LOG:  Duplicate failover request from &quot;pg1:5432 Linux pg1&quot;<br>
&gt;&gt; node<br>
&gt;&gt; &gt;&gt; pid 1234: DETAIL:  request ignored<br>
&gt;&gt; &gt;&gt; pid 1234: LOG:  failover requires the majority vote, waiting for<br>
&gt;&gt; consensus<br>
&gt;&gt; &gt;&gt; pid 1234: DETAIL:  failover request noted<br>
&gt;&gt; &gt;&gt; pid 4321: LOG:  degenerate backend request for 1 node(s) from pid<br>
&gt;&gt; [4321],<br>
&gt;&gt; &gt;&gt; is changed to quarantine node request by watchdog<br>
&gt;&gt; &gt;&gt; pid 4321: DETAIL:  watchdog is taking time to build consensus<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Note that this case dosen&#39;t have any communication truouble among<br>
&gt;&gt; &gt;&gt; the Pgpool watchdog nodes.<br>
&gt;&gt; &gt;&gt; You can reproduce it by changing one PostgreSQL&#39;s pg_hba.conf to<br>
&gt;&gt; &gt;&gt; reject the helth check access from one pgpool node in short period.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; The document don&#39;t say that duplicate failover requests make the node<br>
&gt;&gt; &gt;&gt; quarantine immediately. I think it should be just igunoring the request.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; A patch file for head of V3_7_STABLE is attached.<br>
&gt;&gt; &gt;&gt; Pgpool with this patch also disturbs failover by single pgpool&#39;s<br>
&gt;&gt; repeated<br>
&gt;&gt; &gt;&gt; failover requests. But it can recover when the connection trouble is<br>
&gt;&gt; gone.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Does this change have any problem?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; with best regards,<br>
&gt;&gt; &gt;&gt; TAKATSUKA Haruka &lt;<a href="mailto:harukat@sraoss.co.jp" target="_blank">harukat@sraoss.co.jp</a>&gt;<br>
&gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; pgpool-hackers mailing list<br>
&gt;&gt; &gt;&gt; <a href="mailto:pgpool-hackers@pgpool.net" target="_blank">pgpool-hackers@pgpool.net</a><br>
&gt;&gt; &gt;&gt; <a href="http://www.pgpool.net/mailman/listinfo/pgpool-hackers" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-hackers</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt;<br>
</blockquote></div></div>