<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 27, 2019 at 10:25 AM 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; Hello, Usama and pgpool-hackers<br>
&gt; <br>
&gt; Thank you very much for writing and committing patches to solve the issue<br>
&gt; that I reported.<br>
&gt; <br>
&gt; What do you think about back-patching them into 3.7.x or older versions?<br>
&gt; Pgpool-II watchdog cluster can easily fall into the status that doesn&#39;t<br>
&gt; work without the patch.<br>
&gt; <br>
&gt; The quarantine feature hasn&#39;t been documented in detail up to now, so<br>
&gt; I think the behavior change of the first patch (*1) has no problem.<br>
&gt; My customer who has trouble related to this mail thread uses 3.7.x version<br>
&gt; and strongly hopes such a pgpool improvement.<br>
&gt; <br>
&gt; *1<br>
&gt; <a href="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commitdiff;h=3dd1cd3f1528" rel="noreferrer" target="_blank">https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commitdiff;h=3dd1cd3f1528</a><br>
<br>
We know that this patch breaks existing regression test. So I don&#39;t<br>
think no user would notice the behavior change if the patch is<br>
back ported.<br></blockquote><div><br></div><div>I sort of agree with Takatsuka San, that the continuous health checking on the quarantined backed nodes (first patch)</div><div>is not the kind of change that should cause problems if we decide to backport it to older branches, In fact. it should be treated</div><div>as a bug and back-patched to all affected branches. Also, the reason for the test case failure happening after that commit</div><div>was not because of the behaviour or functionality change. rather it was due to the missing facility in health-check</div><div>debugging/testing mechanism which was required by that test case after the change. </div><div><br></div><div>Thanks</div><div>Best regards </div><div>Muhammad Usama</div><div>  </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<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_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
<br>
&gt; Thanks,<br>
&gt; Haruka Takatsuka<br>
&gt; <br>
&gt; <br>
&gt; On Tue, 21 May 2019 12:00:03 +0500<br>
&gt; Muhammad Usama &lt;<a href="mailto:m.usama@gmail.com" target="_blank">m.usama@gmail.com</a>&gt; wrote:<br>
&gt; <br>
&gt;&gt; Hi Ishii-San<br>
&gt;&gt; <br>
&gt;&gt; The discussion on the thread  [pgpool-hackers: 3318] yielded two patches,<br>
&gt;&gt; one was related<br>
&gt;&gt; to continuing the health check on the quarantined node and the other one<br>
&gt;&gt; was related to the<br>
&gt;&gt; de-escalation and resigning of the master watchdog if the primary backend<br>
&gt;&gt; node gets into<br>
&gt;&gt; quarantine state on the master.<br>
&gt;&gt; So this commit only takes care of the first part that is to continue health<br>
&gt;&gt; check and I still have<br>
&gt;&gt; to commit the second patch taking care of the resigning from master status<br>
&gt;&gt; part. The regression<br>
&gt;&gt; failure of  test 013.watchdog_failover_require_consensus will also follow<br>
&gt;&gt; the second patch for this issue.<br>
&gt;&gt; <br>
&gt;&gt; I am sorry I think I am missing something on the part of consensus made in<br>
&gt;&gt; the discussion,<br>
&gt;&gt; I think we agreed on the thread to commit both the patch  but only in the<br>
&gt;&gt; master branch since<br>
&gt;&gt; it was change of the existing behaviour and we don&#39;t wanted to back port it<br>
&gt;&gt; to older branches.<br>
&gt;&gt; <br>
&gt;&gt; Please see the snippet from our discussion on the thread from which I infer<br>
&gt;&gt; that we are in agreement<br>
&gt;&gt; to commit the changes<br>
&gt;&gt; <br>
&gt;&gt; --quote--<br>
&gt;&gt; ...<br>
&gt;&gt; &gt; Now if we look at the quarantine nodes, they are just as good as alive<br>
&gt;&gt; &gt; nodes (but unreachable by pgpool at the moment).<br>
&gt;&gt; &gt; Because when the node was quarantined, Pgpool-II never executed any<br>
&gt;&gt; &gt; failover and/or follow_master commands<br>
&gt;&gt; &gt; and did not interfered with the PostgreSQL backend in any way to alter its<br>
&gt;&gt; &gt; timeline or recovery states,<br>
&gt;&gt; &gt; So when the quarantine node becomes reachable again it is safe to<br>
&gt;&gt; &gt; automatically connect them back to the Pgpool-II<br>
&gt;&gt; <br>
&gt;&gt; Ok, that makes sense.<br>
&gt;&gt; <br>
&gt;&gt; &gt;&gt; &gt;&gt; BTW,<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; &gt; When the communication between master/coordinator pgpool and<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; &gt; primary PostgreSQL node is down during a short period<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; I wonder why you don&#39;t set appropriate health check retry parameters<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; to avoid such a temporary communication failure in the firs place. A<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; brain surgery to ignore the error reports from Pgpool-II does not<br>
&gt;&gt; seem<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; to be a sane choice.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; The original reporter didn&#39;t answer my question. I think it is likely<br>
&gt;&gt; &gt;&gt; &gt;&gt; a problem of misconfiguraton (should use longer heath check retry).<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; In summary I think for shorter period communication failure just<br>
&gt;&gt; &gt;&gt; &gt;&gt; increasing health check parameters is enough. However for longer<br>
&gt;&gt; &gt;&gt; &gt;&gt; period communication failure, the watchdog node should decline the<br>
&gt;&gt; &gt;&gt; &gt;&gt; role.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; I am sorry I didn&#39;t totally get it what you mean here.<br>
&gt;&gt; &gt;&gt; &gt; Do you mean that the pgpool-II node that has the primary node in<br>
&gt;&gt; &gt;&gt; quarantine<br>
&gt;&gt; &gt;&gt; &gt; state should resign from the master/coordinator<br>
&gt;&gt; &gt;&gt; &gt; pgpool-II node (if it was a master/coordinator) in that case?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Yes, exactly. Note that if the PostgreSQL node is one of standbys,<br>
&gt;&gt; &gt;&gt; keeping the quarantine state is fine because users query could be<br>
&gt;&gt; &gt;&gt; processed.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Yes that makes total sense. I will make that change as separate patch.<br>
&gt;&gt; <br>
&gt;&gt; Thanks. However this will change existing behavior. Probably we should<br>
&gt;&gt; make the change against master branch only?<br>
&gt;&gt; <br>
&gt;&gt; --un quote--<br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt; On Tue, May 21, 2019 at 4:32 AM Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt; wrote:<br>
&gt;&gt; <br>
&gt;&gt; &gt; Usama,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Since this commit regression test/buildfarm are failing:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; testing 013.watchdog_failover_require_consensus... failed.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Also I think this commit seems to be against the consensus made in the<br>
&gt;&gt; &gt; discussion [pgpool-hackers: 3295] thread.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I thought we agreed on [pgpool-hackers: 3318] so that:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ---------------------------------------------------------------------<br>
&gt;&gt; &gt; Hi Usama,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt; Hi<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; I have drafted a patch to make the master watchdog node resigns from<br>
&gt;&gt; &gt; master<br>
&gt;&gt; &gt; &gt; responsibilities if it fails to get the consensus for its<br>
&gt;&gt; &gt; &gt; primary backend node failover request. The patch is still little short on<br>
&gt;&gt; &gt; &gt; testing but I want to share the early version to get<br>
&gt;&gt; &gt; &gt; the feedback on behaviour.<br>
&gt;&gt; &gt; &gt; Also with this implementation the master/coordinator node only resigns<br>
&gt;&gt; &gt; from<br>
&gt;&gt; &gt; &gt; being a master<br>
&gt;&gt; &gt; &gt; when it fails to get the consensus for the primary node failover, but in<br>
&gt;&gt; &gt; &gt; case of failed consensus for standby node failover<br>
&gt;&gt; &gt; &gt; no action is taken by the watchdog master node. Do you think master<br>
&gt;&gt; &gt; should<br>
&gt;&gt; &gt; &gt; also resign in this case as well ?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I don&#39;t think so because still queries can be routed to primary (or<br>
&gt;&gt; &gt; other standby servers if there are two or more standbys).<br>
&gt;&gt; &gt;<br>
&gt;&gt; <br>
&gt;&gt; My understand from this part of discussion was that, we agreed to keep the<br>
&gt;&gt; master status<br>
&gt;&gt; of the watchdog node if one of the standby node on the pgpool<br>
&gt;&gt; watchdog-master gets into<br>
&gt;&gt; quarantine and only go for resignation if the primary gets quarantine.<br>
&gt;&gt; <br>
&gt;&gt; Have I misunderstood something?<br>
&gt;&gt; <br>
&gt;&gt; Thanks<br>
&gt;&gt; Best regards<br>
&gt;&gt; Muhammad Usama<br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt; &gt; ---------------------------------------------------------------------<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; From: Muhammad Usama &lt;<a href="mailto:m.usama@gmail.com" target="_blank">m.usama@gmail.com</a>&gt;<br>
&gt;&gt; &gt; Subject: [pgpool-committers: 5734] pgpool: Fix for [pgpool-hackers: 3295]<br>
&gt;&gt; &gt; duplicate failover request ...<br>
&gt;&gt; &gt; Date: Wed, 15 May 2019 21:40:01 +0000<br>
&gt;&gt; &gt; Message-ID: &lt;<a href="mailto:E1hR1d3-0005o4-1k@gothos.postgresql.org" target="_blank">E1hR1d3-0005o4-1k@gothos.postgresql.org</a>&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt; Fix for [pgpool-hackers: 3295] duplicate failover request ...<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Pgpool should keep the backend health check running on quarantined nodes<br>
&gt;&gt; &gt; so<br>
&gt;&gt; &gt; &gt; that when the connectivity resumes, they should automatically get removed<br>
&gt;&gt; &gt; &gt; from the quarantine. Otherwise the temporary network glitch could send<br>
&gt;&gt; &gt; the node<br>
&gt;&gt; &gt; &gt; into permanent quarantine state.<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Branch<br>
&gt;&gt; &gt; &gt; ------<br>
&gt;&gt; &gt; &gt; master<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Details<br>
&gt;&gt; &gt; &gt; -------<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; <a href="https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=3dd1cd3f15287ee6bb8b09f0642f99db98e9776a" rel="noreferrer" target="_blank">https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=3dd1cd3f15287ee6bb8b09f0642f99db98e9776a</a><br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Modified Files<br>
&gt;&gt; &gt; &gt; --------------<br>
&gt;&gt; &gt; &gt; src/main/health_check.c | 28 ++++++++++++++++++++++++----<br>
&gt;&gt; &gt; &gt; 1 file changed, 24 insertions(+), 4 deletions(-)<br>
&gt;&gt; &gt; &gt;<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; pgpool-hackers mailing list<br>
&gt; <a href="mailto:pgpool-hackers@pgpool.net" target="_blank">pgpool-hackers@pgpool.net</a><br>
&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>
_______________________________________________<br>
pgpool-hackers mailing list<br>
<a href="mailto:pgpool-hackers@pgpool.net" target="_blank">pgpool-hackers@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-hackers" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-hackers</a><br>
</blockquote></div></div>