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

Emond Papegaaij emond.papegaaij at gmail.com
Tue Jan 25 23:57:51 JST 2022


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.

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


More information about the pgpool-general mailing list