[pgpool-general: 6410] Incorrectly reported old primary node id

Andre Piwoni apiwoni at webmd.net
Wed Feb 13 02:44:29 JST 2019


I have cluster of two nodes with failover script which promotes primary
node only when ${failed_node_id} = ${old_primary_node_id}
After failover from node1 to node2 is successfully executed, second
failover attempt from node2 to node1 fails because old primary node is
incorrectly reported.
Other people seem to have problems with reporting old primary node id
https://www.pgpool.net/mantisbt/view.php?id=112
I noticed that many failover scripts do not check if ${failed_node_id} =
${old_primary_node_id} before promotion so my question is a follows.
Given this flakiness in reporting, is there any reason to perform this test
in failover script before promotion? I run PgPool-II 3.7.3.

Here's relevant info:

systemctl start pgpool
Feb 12 09:13:01 pg-hdp-node1 pgpool[25308]: [7-1] 2019-02-12 09:13:01: pid
25308: LOG:  find_primary_node: primary node id is 1

postgres=> show pool_nodes;
 node_id |          hostname          | port | status | lb_weight |  role
 | select_cnt | load_balance_node | replication_delay
---------+----------------------------+------+--------+-----------+---------+------------+-------------------+-------------------
 0       | pg-hdp-node1.kitchen.local | 5432 | up     | 0.500000  | standby
| 0          | false             | 0
 1       | pg-hdp-node2.kitchen.local | 5432 | up     | 0.500000  | primary
| 0          | true              | 0

pg-hdp-node2.kitchen.local> systemctl stop postgresql-10
Feb 12 09:15:06 pg-hdp-node1 pgpool[25308]: [9-1] 2019-02-12 09:15:06: pid
25308: LOG:  Pgpool-II parent process has received failover request
Feb 12 09:15:06 pg-hdp-node1 pgpool[25308]: [10-1] 2019-02-12 09:15:06: pid
25308: LOG:  starting degeneration. shutdown host
pg-hdp-node2.kitchen.local(5432)

[root at pg-hdp-node1 pgpool]# cat failover.log
failed_node_id           1
failed_node_host         pg-hdp-node2.kitchen.local
failed_node_port         5432
failed_node_pgdata       /var/lib/pgsql/10/data
old_primary_node_id      0
old_master_node_id       0
new_master_node_id       0
new_master_node_host     pg-hdp-node1.kitchen.local
new_master_node_port     5432
new_master_node_pgdata   /var/lib/pgsql/10/data

Old primary node id should 1.

*Andre Piwoni*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20190212/10f26176/attachment.html>


More information about the pgpool-general mailing list