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

Emond Papegaaij emond.papegaaij at gmail.com
Wed Jan 26 00:49:26 JST 2022


On Tue, Jan 25, 2022 at 3:57 PM Emond Papegaaij <emond.papegaaij at gmail.com>
wrote:

> On Tue, Jan 25, 2022 at 2:19 PM Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
>
>> > After more thought, I think get_nodes ("gut" of pcp_node_info) should
>> > not try to connect to PostgreSQL at all if it already knows the
>> > PostgreSQL server is down (actually get_nodes() calls PQpingParams()
>> > and it already knows whether PostgreSQL server is up or not). In this
>> > case it can immediately return "unknown" for pg_role field, and thus
>> > it can avoid the hang.
>> >
>> > Attached is the patch. In the mean time please disregard the previous
>> patch.
>>
>> Oops. I attached wrong patch. I attach the new patch.
>>
>
> I've pinpointed the issue to the exact location changed by your patch.
> With plain 4.3.0, the worker stops at this line:
>  snprintf(nodes[i].pg_status, POOLCONFIG_MAXSTATLEN, "%s",
> db_node_status(i));
>
> I've inserted a log statement right before and after that line. The one
> before shows up, the one after does not. I'll give your patch a try now.
>

As I expected to happen, with your patch, the pcp worker still hangs, but
no longer tries to connect to the database. Your patch moves the call to
db_node_status to before the database connection, so now it seems to hang
before connecting. I'll continue my effort in pinpointing the exact
location of the failure by adding tracing to the db_node_status function.

Best regards,
Emond
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20220125/bf4d6345/attachment.htm>


More information about the pgpool-general mailing list