Fix long standing bug with pcp_node_info.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 31 Jan 2022 02:45:33 +0000 (11:45 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 31 Jan 2022 03:33:43 +0000 (12:33 +0900)
commit3f3c8ade3cc0c66ffa9e9a5f476c98c9f9ae1a6d
tree2bfe1b7517342621e110412b9eddbe4c0e24eeaf
parent20b9a031680bc5a6e1d190996a1cf94b93d2bf79
Fix long standing bug with pcp_node_info.

It appears that occasionally pcp_node_info shows backend_status field
as "quarantine" when it should be "down". While pcp_node_info shows
the status, first it checks the backend_status member in BackendInfo
struct. If it is 3, then checks quarantine member. If it is other than
0, then the backend_status field is shown as "quarantine". So if
garbage remains in quarantine member, it is shown as "quarantine". The
BackendInfo struct is transferred from pcp_worker process to pcp
frontend client. Unfortunately when the quarantine member was added by
commit 54af632c, it was forgotten to modify pcp_worker.c and
pcp_frontend.c so that the "quarantine" member is transferred.

Fix is needed to be back patched to 3.7, when the "quarantine" member
was first added.

Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2022-January/004110.html
src/libs/pcp/pcp.c
src/pcp_con/pcp_worker.c