<div dir="ltr"><div>Hi Ishii San</div><div><br></div><div>Thanks for figuring out the issue.</div><div>I think removing the code in question altogether could mark the remote node as dead too early at startup and can delay the watchdog cluster stabilization</div><div>when there is a few seconds delay between the node startup.</div><div>So IMHO the way to solve this is to wait for twice the wd_interval or wd_heartbeat_deadtime (depending on the configuration) if is_wd_lifecheck_ready()</div><div>reports a failure.</div><div><br></div><div>What do you think of the attached patch?</div><div><br></div><div>Best regards</div><div>Muhammad Usama</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 15, 2023 at 6:28 PM Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp">ishii@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">> The bind error itself sometimes we cannot avoid. But problem is, the<br>
> leader watchdog node (pgpool0) goes into an infinite loop in<br>
> wd_lifecheck.c:lifecheck_main():<br>
> <br>
> /* wait until ready to go */<br>
> while (WD_OK != is_wd_lifecheck_ready())<br>
> {<br>
> sleep(pool_config->wd_interval * 10);<br>
> }<br>
> <br>
> If is_wd_lifecheck_ready() fails to receive heartbeat signal, it<br>
> returns WD_NG and the loop continues again. As a result, the<br>
> regression test failed with timeout (attached pgpool0.log). There's no<br>
> way to avoid bind on socket error and I think what we can do is, just<br>
> sleep before start watchdog.<br>
> <br>
> But in my opinion the infinite loop above is a real issue in<br>
> production systems. Can we try the loop continue in limited time and<br>
> if it does not succeed, disregard the node in question?<br>
<br>
Or can't we just remove the code above? If other node is fine, we<br>
don't need to wait. If other node is down, it will be detected later<br>
on anyway and we don't need to wait too.<br>
<br>
For trial I removed the code (see attached patch) and ran the<br>
regression test. All tests passed.<br>
<br>
Best reagards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS LLC<br>
English: <a href="http://www.sraoss.co.jp/index_en/" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en/</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
</blockquote></div></div>