| From: | Tatsuo Ishii <ishii(at)postgresql(dot)org> |
|---|---|
| To: | fluca1978(at)gmail(dot)com |
| Cc: | pgpool-general(at)lists(dot)postgresql(dot)org |
| Subject: | Re: rebooting a standby causes it go down on pgpool side |
| Date: | 2025-11-04 02:32:19 |
| Message-ID: | 20251104.113219.411936663096048386.ishii@postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgpool-general |
> Hi all,
> I've three identical machines, running pgpool 4.6.2, postgres 17, one
> primary (pg1) and two standby pg2 and pg3.
>
> The initial situation is:
>
> % ssh pg1 'sudo -u postgres pcp_node_info -U pgpool'
> pg1 5432 1 0.166667 waiting up primary primary 0 none none 2025-10-30 11:01:05
> pg2 5432 1 0.333333 waiting up standby standby 0 streaming async
> 2025-10-30 11:01:05
> pg3 5432 1 0.500000 waiting up standby standby 0 streaming async
> 2025-10-30 11:01:05
>
>
> % ssh pg2 'sudo -u postgres pcp_node_info -U pgpool'
> pg1 5432 1 0.166667 waiting up primary primary 0 none none 2025-10-30 11:01:10
> pg2 5432 1 0.333333 waiting up standby standby 0 streaming async
> 2025-10-30 11:01:10
> pg3 5432 1 0.500000 waiting up standby standby 0 streaming async
> 2025-10-30 11:01:10
>
> % ssh pg3 'sudo -u postgres pcp_node_info -U pgpool'
> pg1 5432 1 0.166667 waiting up primary primary 0 none none 2025-10-30 11:01:10
> pg2 5432 1 0.333333 waiting up standby standby 0 streaming async
> 2025-10-30 11:01:10
> pg3 5432 1 0.500000 waiting up standby standby 0 streaming async
> 2025-10-30 11:01:10
>
>
> I don't know why, the machines are reported as "waiting up" even if
> eveything is working fine and I've waited several minutes without
> having any change in the status.
From the official document:
"2 - Node is up. Connections are pooled."
https://www.pgpool.net/docs/latest/en/html/pcp-node-info.html
So you can safely assume that "waiting" also meabs node is up (for
pgpool). To change the status from "waiting" to "up", you can issue
any SQL command (for example show pool_nodes") to pgpool.
> Now, if I reboot a standby, let's say node 3, it comes up with a "down
> up" status and the only mode I've to make pgpool see the node as
> healthy again is to run pcp_attach_node.
>
>
> % ssh pg3 'sudo reboot'
>
> % ssh pg1 'sudo -u postgres pcp_node_info -U pgpool'
> pg1 5432 1 0.166667 waiting up primary primary 0 none none 2025-10-30 11:01:05
> pg2 5432 1 0.333333 waiting up standby standby 0 streaming async
> 2025-10-30 11:01:05
> pg3 5432 3 0.500000 down up standby standby 0 streaming async
> 2025-10-30 11:08:21
>
> % ssh pg2 'sudo -u postgres pcp_node_info -U pgpool'
> pg1 5432 1 0.166667 waiting up primary primary 0 none none 2025-10-30 11:01:10
> pg2 5432 1 0.333333 waiting up standby standby 0 streaming async
> 2025-10-30 11:01:10
> pg3 5432 3 0.500000 down up standby standby 0 streaming async
> 2025-10-30 11:08:21
>
> % ssh pg3 'sudo -u postgres pcp_node_info -U pgpool'
> pg1 5432 1 0.166667 waiting up primary primary 0 none none 2025-10-30 11:09:08
> pg2 5432 1 0.333333 waiting up standby standby 0 streaming async
> 2025-10-30 11:09:08
> pg3 5432 3 0.500000 down up standby standby 0 streaming async
> 2025-10-30 11:09:08
>
> Is this normal? Because the node is streaming regularly, so it is fine
> on the postgres side and it should also take over its last status at
> boot (i.e, at least waiting).
>
> Anything I should dig for?
I think what happens there is, pgpool's health check detects
PostgreSQL on pg3 goes down and trigger failover on pg3 pgpool. As
stated somewhere in the official docs, pgpool automatically sets
PostgreSQL to down status, but not automatically change the status to
up (or waiting). This is not a bug. It's by design. If you want to
make the status to up automatically, please consider using
auto_failback.
If you want to avoid the failover, you can tweak the health check
parameters so that while PostgreSQL rebooting, the health check
repeatedly retries. For example, increase health_check_max_retries.
Note that health_check parameters can be changed by reloading
pgpool.conf. So you can change the parameter and restore to previous
value without rebooting pgpool.
Best regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Luca Ferrari | 2025-11-06 08:06:11 | Re: rebooting a standby causes it go down on pgpool side |
| Previous Message | Tatsuo Ishii | 2025-11-04 01:36:53 | Re: what is causing different pcp_node_info status |