<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">Hello<br />
<br />
I have a setup with 3 postgres nodes running behind one pgpool docker container.<br />
<br />
The setup works fine when the primary node fails/is shutdown. Failover goes fine in that case.<br />
<br />
However, if the standby goes down, the health check fails but instead of performing a failover, pgpool throws this error message-<br />
<br />
2021-09-23 08:37:54: pid 94: LOG: invalid degenerate backend request, node id : 2 status: [2] is not valid for failover<br />
<br />
What’s a bit strange to me is that this only happens when I am running the pgpool container through Nomad.<br />
<br />
If I run it directly without Nomad, it still works as expected. Even though this is the only difference that I see between the working and non-working setup, I believe this isn’t the root cause.<br />
<br />
If you can point me towards when a degenerate request is considered invalid, it might help.<br />
<br />
Below are the logs for working and non-working setups.<br />
<br />
<br />
<br />
<strong>Non-working Setup Logs:</strong><br />
2021-09-23 08:37:16: pid 414: DETAIL: postmaster on DB node 2 was shutdown by administrative command<br />
2021-09-23 08:37:24: pid 94: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:24: pid 94: DETAIL: Operation now in progress<br />
2021-09-23 08:37:24: pid 94: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:24: pid 94: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:24: pid 94: LOG: health check retrying on DB node: 2 (round:1)<br />
2021-09-23 08:37:26: pid 94: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:26: pid 94: DETAIL: Operation now in progress<br />
2021-09-23 08:37:26: pid 94: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:26: pid 94: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:26: pid 94: LOG: health check retrying on DB node: 2 (round:2)<br />
2021-09-23 08:37:28: pid 94: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:28: pid 94: DETAIL: Operation now in progress<br />
2021-09-23 08:37:28: pid 94: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:28: pid 94: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:28: pid 94: LOG: health check retrying on DB node: 2 (round:3)<br />
2021-09-23 08:37:30: pid 94: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:30: pid 94: DETAIL: Operation now in progress<br />
2021-09-23 08:37:30: pid 94: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:30: pid 94: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:30: pid 94: LOG: health check retrying on DB node: 2 (round:4)<br />
2021-09-23 08:37:32: pid 94: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:32: pid 94: DETAIL: Operation now in progress<br />
2021-09-23 08:37:32: pid 94: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:32: pid 94: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:32: pid 94: LOG: health check retrying on DB node: 2 (round:5)<br />
2021-09-23 08:37:33: pid 342: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:33: pid 342: DETAIL: Operation now in progress<br />
2021-09-23 08:37:33: pid 342: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:33: pid 342: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:34: pid 94: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:34: pid 94: DETAIL: Operation now in progress<br />
2021-09-23 08:37:34: pid 94: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:34: pid 94: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:34: pid 94: LOG: health check failed on node 2 (timeout:0)<br />
2021-09-23 08:37:34: pid 94: LOG: invalid degenerate backend request, node id : 2 status: [2] is not valid for failover<br />
2021-09-23 08:37:44: pid 94: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:44: pid 94: DETAIL: Operation now in progress<br />
2021-09-23 08:37:44: pid 94: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:44: pid 94: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:44: pid 94: LOG: health check retrying on DB node: 2 (round:1)<br />
2021-09-23 08:37:45: pid 414: LOG: Query message from frontend.<br />
2021-09-23 08:37:45: pid 414: DETAIL: query: "show pool_nodes;"<br />
2021-09-23 08:37:46: pid 94: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:46: pid 94: DETAIL: Operation now in progress<br />
2021-09-23 08:37:46: pid 94: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:46: pid 94: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:46: pid 94: LOG: health check retrying on DB node: 2 (round:2)<br />
2021-09-23 08:37:48: pid 94: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:48: pid 94: DETAIL: Operation now in progress<br />
2021-09-23 08:37:48: pid 94: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:48: pid 94: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:48: pid 94: LOG: health check retrying on DB node: 2 (round:3)<br />
2021-09-23 08:37:50: pid 94: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:50: pid 94: DETAIL: Operation now in progress<br />
2021-09-23 08:37:50: pid 94: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:50: pid 94: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:50: pid 94: LOG: health check retrying on DB node: 2 (round:4)<br />
2021-09-23 08:37:52: pid 94: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:52: pid 94: DETAIL: Operation now in progress<br />
2021-09-23 08:37:52: pid 94: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:52: pid 94: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:52: pid 94: LOG: health check retrying on DB node: 2 (round:5)<br />
2021-09-23 08:37:53: pid 342: ERROR: Failed to check replication time lag<br />
2021-09-23 08:37:53: pid 342: DETAIL: No persistent db connection for the node 2<br />
2021-09-23 08:37:53: pid 342: HINT: check sr_check_user and sr_check_password<br />
2021-09-23 08:37:53: pid 342: CONTEXT: while checking replication time lag<br />
2021-09-23 08:37:53: pid 342: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:53: pid 342: DETAIL: Operation now in progress<br />
2021-09-23 08:37:53: pid 342: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:53: pid 342: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:54: pid 94: LOG: failed to connect to PostgreSQL server on "<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>", getsockopt() failed<br />
2021-09-23 08:37:54: pid 94: DETAIL: Operation now in progress<br />
2021-09-23 08:37:54: pid 94: ERROR: failed to make persistent db connection<br />
2021-09-23 08:37:54: pid 94: DETAIL: connection to host:"<a href="http://dbod-ag-test3.ch:6603" target="_blank">dbod-ag-test3.ch:6603</a>" failed<br />
2021-09-23 08:37:54: pid 94: LOG: health check failed on node 2 (timeout:0)<br />
2021-09-23 08:37:54: pid 94: LOG: invalid degenerate backend request, node id : 2 status: [2] is not valid for failover<br />
<br />
<br />
<strong>Working Setup Logs:</strong><br />
2021-09-23 09:45:21: pid 78: DETAIL: postmaster on DB node 2 was shutdown by administrative command<br />
2021-09-23 09:45:21: pid 78: LOG: received degenerate backend request for node_id: 2 from pid [78]<br />
2021-09-23 09:45:21: pid 10: LOG: Pgpool-II parent process has received failover request<br />
2021-09-23 09:45:21: pid 10: LOG: starting degeneration. shutdown host <a href="http://dbod-ag-test3.ch" target="_blank">dbod-ag-test3.ch</a>(6603)</div>
</div>
<div name="messageSignatureSection"><br />
<div class="matchFont">
<div dir="auto">Thanks!
<div dir="auto"><br /></div>
<div dir="auto">Anirudh</div>
</div>
</div>
</div>
</body>
</html>