<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">I have cluster of two nodes with failover script which promotes primary node only when <span style="color:rgb(0,0,0);font-family:Menlo;font-size:9pt">${failed_node_id} = ${old_primary_node_id}</span><div><span style="color:rgb(0,0,0);font-family:Menlo;font-size:9pt">A</span><span style="color:rgb(64,64,64)">fter failover from node1 to node2 is successfully executed, second failover attempt from node2 to node1 fails because old primary node is incorrectly reported.</span></div><div><font color="#404040">Other people seem to have problems with reporting old primary node id <a href="https://www.pgpool.net/mantisbt/view.php?id=112">https://www.pgpool.net/mantisbt/view.php?id=112</a></font></div><div><font color="#404040">I noticed that many failover scripts do not check if </font><span style="color:rgb(0,0,0);font-family:Menlo;font-size:12px">${failed_node_id} = ${old_primary_node_id}</span><span style="color:rgb(64,64,64)"> before promotion so my question is a follows.</span></div><div><span style="color:rgb(64,64,64)">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.</span></div><div><span style="color:rgb(64,64,64)"><br></span></div><div><span style="color:rgb(64,64,64)">Here&#39;s relevant info:</span></div><div><span style="color:rgb(64,64,64)"><br></span></div><div><font color="#404040">systemctl start pgpool</font><br></div><div><div>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<br></div><div><br></div><div><div>postgres=&gt; show pool_nodes;</div><div> node_id |          hostname          | port | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay </div><div>---------+----------------------------+------+--------+-----------+---------+------------+-------------------+-------------------</div><div> 0       | pg-hdp-node1.kitchen.local | 5432 | up     | 0.500000  | standby | 0          | false             | 0</div><div> 1       | pg-hdp-node2.kitchen.local | 5432 | up     | 0.500000  | primary | 0          | true              | 0</div></div><div><br></div><div>pg-hdp-node2.kitchen.local&gt; systemctl stop postgresql-10<br></div><div><div>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</div><div>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)</div></div><div><br></div><div><div>[root@pg-hdp-node1 pgpool]# cat failover.log </div><div>failed_node_id           1</div><div>failed_node_host         pg-hdp-node2.kitchen.local</div><div>failed_node_port         5432</div><div>failed_node_pgdata       /var/lib/pgsql/10/data</div><div>old_primary_node_id      0</div><div>old_master_node_id       0</div><div>new_master_node_id       0</div><div>new_master_node_host     pg-hdp-node1.kitchen.local</div><div>new_master_node_port     5432</div><div>new_master_node_pgdata   /var/lib/pgsql/10/data</div></div><div><br></div><div>Old primary node id should 1.</div><div><br></div><div><b><span style="color:rgb(64,64,64)">Andre Piwoni</span></b><br></div></div></div></div></div></div></div></div></div></div>