[pgpool-general: 8000] Re: pcp_node_info does not return when host is lost on 4.3.0

Tatsuo Ishii ishii at sraoss.co.jp
Wed Jan 26 10:37:48 JST 2022


>> It seems it's the call to PQpingParams in db_node_status that's causing
>> the problems:
>> ret = PQpingParams(keywords, values, 1);
>>
>> The worker never gets past that point for node 2. I hope this helps you
>> address the issue.

Thank you for the analysis. I had never expected PQpingParams() stucks.

> Adding a connect_timeout to this call (and using your first patch) makes
> the process continue. However, the total runtime still suffers
> significantly from these calls. With 2 databases unreachable, the 4.3.0
> implementation spends a total of 4 full connect_timeouts (2 for each
> unreachable database) before it completes. With the timeout set to 10
> seconds, this amounts to 40 seconds per call. As our application still has
> to be compatible with 4.2.6, we need to read the node info for all 3 nodes
> separately, giving a total runtime of over 2 minutes.
> 
> Personally, I would expect pcp_node_info to return the state as known by
> pgpool at the moment and not probe the databases itself. In our test, the
> database are not shutdown properly, so pgpool has not yet had a chance to
> detected the failure. At that moment, I would expect pcp_node_info to
> simply report 'up'. This would eliminate the timeouts we are seeing. The
> status would only change after pgpool detected that the backend is not
> responding anymore.

Maybe. Let me think more.

> If that's not possible, the number of timeouts should be reduced to an
> absolute minimum.

Ok, I would add timeout 1 second (that's the minimum) to the call for
PQpingParams.

> Why is pcp_node_info checking the status of every
> backend, while I only request the status of a single backend?

I don't realize it. If so, it must be a bug. Let me check.

> Also, it
> should not try to connect twice. If the first attempt fails, the second
> should be skipped.

Best reagards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


More information about the pgpool-general mailing list