[pgpool-committers: 8470] pgpool: Fix invalid degenerate backend request problem.

Tatsuo Ishii ishii at sraoss.co.jp
Thu Mar 3 16:58:10 JST 2022

Fix invalid degenerate backend request problem.

When health check process sends failover request, it fails in rare
cases with message: "invalid degenerate backend request , node id : 2
status: [2] is not valid for failover". This is caused if backend node
status managed in private_backend_status and the one in the share
memory area do not agree. private_backend_status is initialized upon
starting up of process. It's not updated during process's life
cycle. Usually this is ok, but for example consider following

(1) When pgpool starts, node 1 is down in pgpool_status. So health
check process did not start for node 1.

(2) pcp_promote_node --switchover gets called. Health check process
for node 1 starts and private_backend_status for node 1 remains down.

(3) Node 1 is back to online by follow master command.

(4) Node 1 is shutdown.

(5) The health check process detects node 1 is down and requests
failover. But since private_backend_status is down, it is refused with
the message.

To fix this, we can simply delete the call to
pool_initialize_private_backend_status() at the process start
up. Originally the intention for private_backend_status() is that
pgpool child process is not bothered by the status change in the
middle of process. This is not necessary for health check and
streaming replication check.

Note that I was not able to find a scenario for prior 4.3. Once I
find, I will back patch this to pre 4.3 branches.

Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2022-February/004128.html



Modified Files
src/main/health_check.c                       | 3 ---
src/streaming_replication/pool_worker_child.c | 3 ---
2 files changed, 6 deletions(-)

More information about the pgpool-committers mailing list