<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">Hello<br />
<br />
I am upgrading my PgPool setup from version 4.2.2 to 4.3.2.<br />
<br />
I was testing the new parameter that this version introduces - failover_on_backend_shutdown, but it doesn’t seem to work.<br />
<br />
My setup is 1 PgPool (4.3.2), 1 primary postgres, 2 replica postgres (all 12.5).<br />
<br />
Initially, failover_on_backend_shutdown was turned on, then I turned it off from the config file and did a reload of PgPool.<br />
<br />
The option is shown correctly when I query it in runtime:<br />
<br />
postgres=# pgpool show failover_on_backend_shutdown;<br />
 failover_on_backend_shutdown<br />
------------------------------<br />
 off<br />
(1 row)<br />
<br />
postgres=# show pool_version;<br />
 pool_version<br />
-----------------------<br />
 4.3.2 (tamahomeboshi)<br />
(1 row)<br />
<br />
But then I tried turning off the primary instance by using systemctl stop ag_test_01<br />
<br />
PgPool recognises that the node has been shutdown with an administrative command but continues to perform a failover anyway.<br />
<br />
Please see the logs below (the logs are for node 0 and 2, node 1 was turned off earlier and showed the same behaviour):<br />
<br />
2022-07-29 08:51:13 psql [592] LOG: reading and processing packets<br />
2022-07-29 08:51:13 psql [592] DETAIL: postmaster on DB node 0 was shutdown by administrative command<br />
2022-07-29 08:51:13 psql [592] LOCATION: pool_process_query.c:4898<br />
2022-07-29 08:51:13 psql [592] LOG: pool_ssl: "SSL_read": "no SSL error reported"<br />
2022-07-29 08:51:13 psql [592] LOCATION: pool_ssl.c:420<br />
2022-07-29 08:51:13 psql [592] LOG: received degenerate backend request for node_id: 0 from pid [592]<br />
2022-07-29 08:51:13 psql [592] LOCATION: pool_internal_comms.c:147<br />
2022-07-29 08:51:13 psql [592] LOG: signal_user1_to_parent_with_reason(0)<br />
2022-07-29 08:51:13 psql [592] LOCATION: pgpool_main.c:612<br />
2022-07-29 08:51:13 psql [592] LOG: frontend disconnection: session time: 0:04:33.619 user=postgres database=postgres host=<a href="http://ec2-16-16-0-1.eu-north-1.compute.amazonaws.com" target="_blank">ec2-16-16-0-1.eu-north-1.compute.amazonaws.com</a> port=44486<br />
2022-07-29 08:51:13 psql [592] LOCATION: child.c:2045<br />
2022-07-29 08:51:13 main [8] LOG: Pgpool-II parent process received SIGUSR1<br />
2022-07-29 08:51:13 main [8] LOCATION: pgpool_main.c:1293<br />
2022-07-29 08:51:13 main [8] LOG: Pgpool-II parent process has received failover request<br />
2022-07-29 08:51:13 main [8] LOCATION: pgpool_main.c:1358<br />
2022-07-29 08:51:13 main [8] LOG: starting degeneration. shutdown host <a href="http://dbod-ag-test-01.ch" target="_blank">dbod-ag-test-01.ch</a>(6605)<br />
2022-07-29 08:51:13 main [8] LOCATION: pgpool_main.c:1652<br />
2022-07-29 08:51:13 main [8] LOG: Restart all children<br />
2022-07-29 08:51:13 main [8] LOCATION: pgpool_main.c:1820<br />
2022-07-29 08:51:13 main [8] LOG: execute command: /usr/local/bin/failover.py 0 <a href="http://dbod-ag-test-01.ch" target="_blank">dbod-ag-test-01.ch</a> 6605 /ORA/dbs03/AG_TEST_01/data 2 <a href="http://dbod-ag-test-03.ch" target="_blank">dbod-ag-test-03.ch</a> 0 0 6607 /ORA/dbs03/AG_TEST_03/data <a href="http://dbod-ag-test-01.ch" target="_blank">dbod-ag-test-01.ch</a> 6605<br />
2022-07-29 08:51:13 main [8] LOCATION: pgpool_main.c:2961<br />
2022-07-29 08:51:14 main [8] LOG: find_primary_node_repeatedly: waiting for finding a primary node<br />
2022-07-29 08:51:14 main [8] LOCATION: pgpool_main.c:3418<br />
2022-07-29 08:51:14 main [8] LOG: find_primary_node: primary node is 2<br />
2022-07-29 08:51:14 main [8] LOCATION: pgpool_main.c:3338<br />
2022-07-29 08:51:14 main [8] LOG: starting follow degeneration. shutdown host <a href="http://dbod-ag-test-01.ch" target="_blank">dbod-ag-test-01.ch</a>(6605)<br />
2022-07-29 08:51:14 main [8] LOCATION: pgpool_main.c:1966<br />
2022-07-29 08:51:14 main [8] LOG: starting follow degeneration. shutdown host <a href="http://dbod-ag-test-02.ch" target="_blank">dbod-ag-test-02.ch</a>(6606)<br />
2022-07-29 08:51:14 main [8] LOCATION: pgpool_main.c:1966<br />
2022-07-29 08:51:14 main [8] LOG: failover: 2 follow backends have been degenerated<br />
2022-07-29 08:51:14 main [8] LOCATION: pgpool_main.c:1985<br />
2022-07-29 08:51:14 main [8] LOG: failover: set new primary node: 2<br />
2022-07-29 08:51:14 main [8] LOCATION: pgpool_main.c:2012<br />
2022-07-29 08:51:14 main [8] LOG: failover: set new main node: 2<br />
2022-07-29 08:51:14 main [8] LOCATION: pgpool_main.c:2019<br />
2022-07-29 08:51:14 follow_child [643] LOG: start triggering follow command.<br />
2022-07-29 08:51:14 follow_child [643] LOCATION: pgpool_main.c:3480<br />
2022-07-29 08:51:14 follow_child [643] LOG: execute command: /usr/local/bin/follow_primary.sh 0 <a href="http://dbod-ag-test-01.ch" target="_blank">dbod-ag-test-01.ch</a> 6605 /ORA/dbs03/AG_TEST_01/data 2 <a href="http://dbod-ag-test-03.ch" target="_blank">dbod-ag-test-03.ch</a> 0 0 6607 /ORA/dbs03/AG_TEST_03/data <a href="http://dbod-ag-test-01.ch" target="_blank">dbod-ag-test-01.ch</a> 6605<br />
2022-07-29 08:51:14 follow_child [643] LOCATION: pgpool_main.c:2961<br />
failover done. shutdown host <a href="http://dbod-ag-test-01.ch" target="_blank">dbod-ag-test-01.ch</a>(6605)2022-07-29 08:51:14 main [8] LOG: failover done. shutdown host <a href="http://dbod-ag-test-01.ch" target="_blank">dbod-ag-test-01.ch</a>(6605)<br />
2022-07-29 08:51:14 main [8] LOCATION: pgpool_main.c:2146<br />
2022-07-29 08:51:14 sr_check_worker [577] LOG: worker process received restart request<br />
2022-07-29 08:51:14 sr_check_worker [577] LOCATION: pool_worker_child.c:167<br />
2022-07-29 08:51:14 follow_child [643] LOG: execute command: /usr/local/bin/follow_primary.sh 1 <a href="http://dbod-ag-test-02.ch" target="_blank">dbod-ag-test-02.ch</a> 6606 /ORA/dbs03/AG_TEST_02/data 2 <a href="http://dbod-ag-test-03.ch" target="_blank">dbod-ag-test-03.ch</a> 0 0 6607 /ORA/dbs03/AG_TEST_03/data <a href="http://dbod-ag-test-01.ch" target="_blank">dbod-ag-test-01.ch</a> 6605<br />
2022-07-29 08:51:14 follow_child [643] LOCATION: pgpool_main.c:2961<br />
2022-07-29 08:51:15 pcp_main [569] LOG: restart request received in pcp child process<br />
2022-07-29 08:51:15 pcp_main [569] LOCATION: pcp_child.c:169<br />
2022-07-29 08:51:15 main [8] LOG: PCP child 569 exits with status 0 in failover()<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2190<br />
2022-07-29 08:51:15 main [8] LOG: fork a new PCP child pid 740 in failover()<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2194<br />
2022-07-29 08:51:15 pcp_main [740] LOG: PCP process: 740 started<br />
2022-07-29 08:51:15 pcp_main [740] LOCATION: pcp_child.c:162<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 571 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 572 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 573 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 574 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 575 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 576 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: worker child process with pid: 577 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: fork a new worker child process with pid: 741<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2588<br />
2022-07-29 08:51:15 sr_check_worker [741] LOG: process started<br />
2022-07-29 08:51:15 sr_check_worker [741] LOCATION: pgpool_main.c:729<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 578 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 579 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 580 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 581 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 582 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 583 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 584 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 585 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 586 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 587 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 588 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 589 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 590 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 591 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 592 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 593 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 594 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 595 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 596 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 597 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 598 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 599 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 600 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 601 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 602 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 603 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 604 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 605 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 606 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 607 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 608 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 609 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 610 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 611 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 612 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 613 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 614 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 615 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 616 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 617 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 618 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 619 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 620 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 621 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 622 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 623 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 624 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 625 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 626 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 627 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 628 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 629 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 630 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 631 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 632 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 633 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 634 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 635 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 636 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 637 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 638 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 639 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 640 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 641 exits with status 256<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458<br />
2022-07-29 08:51:15 main [8] LOG: child process with pid: 643 exits with status 0<br />
2022-07-29 08:51:15 main [8] LOCATION: pgpool_main.c:2458</div>
</div>
<div name="messageSignatureSection"><br />
<div class="matchFont">Thank you,</div>
<div class="matchFont" dir="auto"><br /></div>
<div class="matchFont" dir="auto">Anirudh</div>
</div>
</body>
</html>