[pgpool-general: 3832] Re: PGPool-II 3.4.2-1 not saving db state on node detach

Tatsuo Ishii ishii at postgresql.org
Thu Jun 25 08:30:55 JST 2015


> Hi there,
> 
> I'm not sure if it's the intended behavior, but I'm seeing on PGPool-II
> 3.4.2-1 that if I use pcp_detach_node - it works successfully but is not
> persistent across pgpool restarts.
> 
> When the node dies naturally (pgpool detaches it), the status file works
> correctly - this is only on a manual pcp_detach_node
> 
> [me at host ~]$ /usr/pgsql-9.2/bin/psql -U psgsuser -h psghost -p pgport -c
> 'show pool_nodes'
>  node_id |    hostname    | port | status | lb_weight |  role
> ---------+----------------+------+--------+-----------+--------
>  0       | host1          | 5432 | 2      | 0.500000  | master
>  1       | host2          | 5432 | 2      | 0.500000  | slave
> (2 rows)
> 
> [me at host ~]$ /usr/pgpool-9.2/bin/pcp_detach_node 10 localhost 9898 pcpuser
> pcppass 1
> 
> [me at host ~]$ /usr/pgsql-9.2/bin/psql -U psgsuser -h psghost -p pgport -c
> 'show pool_nodes'
>  node_id |    hostname    | port | status | lb_weight |  role
> ---------+----------------+------+--------+-----------+--------
>  0       | host1          | 5432 | 2      | 0.500000  | master
>  1       | host2          | 5432 | 3      | 0.500000  | slave
> (2 rows)
> 
> [me at host ~]$ sudo cat /var/log/pgpool/pgpool_status
> up
> up
> 
> [me at host ~]$ sudo /etc/init.d/pgpool-II-92 stop
> Stopping pgpool-II-92 service:                             [  OK  ]
> 
> [me at host ~]$ sudo cat /var/log/pgpool/pgpool_status
> up
> up
> 
> [me at host ~]$ sudo /etc/init.d/pgpool-II-92 start
> Starting pgpool-II-92 service:                             [  OK  ]
> 
> [me at host ~]$ /usr/pgsql-9.2/bin/psql -U psgsuser -h psghost -p pgport -c
> 'show pool_nodes'
>  node_id |    hostname    | port | status | lb_weight |  role
> ---------+----------------+------+--------+-----------+--------
>  0       | host1          | 5432 | 2      | 0.500000  | master
>  1       | host2          | 5432 | 2      | 0.500000  | slave
> (2 rows)
> 
> [me at host ~]$ sudo cat /var/log/pgpool/pgpool_status
> up
> up
> 
> 
> Is this the intended behavior of pcp_detach_node ?

Yes. pgpool-II will not change the contents of the status file until
it is told a failover event (it could be triggered by either
pcp_detach_node or failover caused by PostgreSQL backend down).

If you do not like it, you can discard the status file and rebuild the
file by using current status, which is maintained by health checking.
(hint: pgpool -D)

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


More information about the pgpool-general mailing list