From 3.7.2, one of the failover script parameters, namely old primary
node was not passed correctly. PRIMARY_NODE_ID macro was used for the
parameter value. Unfortunately it checks the node status since 3.7.2
and gives value 0 if the node is in down status. The node status
could be down if former primary node was going down. To fix this, use
REAL_PRIMARY_NODE_ID macro which returns the current primary node id
regardless the node status.
Problem reported by Pierre Timmermans in [pgpool-general: 6092].
if (nodes[i])
{
trigger_failover_command(i, pool_config->failover_command,
- MASTER_NODE_ID, new_master, PRIMARY_NODE_ID);
+ MASTER_NODE_ID, new_master, REAL_PRIMARY_NODE_ID);
sync_required = true;
}
}