<div dir="ltr"><div dir="ltr">On Wed, Jan 26, 2022 at 2:37 AM Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">>> It seems it's the call to PQpingParams in db_node_status that's causing<br>
>> the problems:<br>
>> ret = PQpingParams(keywords, values, 1);<br>
>><br>
>> The worker never gets past that point for node 2. I hope this helps you<br>
>> address the issue.<br>
<br>
Thank you for the analysis. I had never expected PQpingParams() stucks.<br></blockquote><div><br></div><div>That's the advantage of being ignorant. I had no expectations at all :)</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">
> If that's not possible, the number of timeouts should be reduced to an<br>
> absolute minimum.<br>
<br>
Ok, I would add timeout 1 second (that's the minimum) to the call for<br>
PQpingParams.<br></blockquote><div><br></div><div>I think the PQpingParams should take the same connect_timeout as configured in the pgpool config. Otherwise this method might hit a timeout while other parts of the code don't. I think that would only cause confusion.</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">
> Why is pcp_node_info checking the status of every<br>
> backend, while I only request the status of a single backend?<br>
<br>
I don't realize it. If so, it must be a bug. Let me check.<br></blockquote><div><br></div><div>The loop is in get_nodes. It always iterates over all nodes. inform_node_info (pcp_worker.c) calls this function and only prints the selected node.</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">
> Also, it<br>
> should not try to connect twice. If the first attempt fails, the second<br>
> should be skipped.<br></blockquote><div><br></div><div>Looking at the previous patches, I think both patches are needed. The last patch (pcp_hang.patch) prevents a second timeout for the same backend when the ping fails. The first (pcp_node_info_hang.patch) is also still needed, because there's a small chance the database will get lost in between the calls. pcp_node_info should not perform retries. So the two things remaining are: setting a connect_timeout on PQpingParams and get_nodes should be refactored to only collect the information for one node if the pcp worker has a node id.</div><div><br></div><div>Best regards,</div><div>Emond</div></div></div>