In watchdog node_id = 0 was reserved for local watchdog node
before 'simplifying watchdog configuration' patch, Now the watchdog
node IDshave become consistent across the cluster, but a couple of
placesĀ in the code were still expecting that node_id = 0 would
mean local node.
{
WatchdogNode *wdNode = NULL;
- if (nodeID == 0) /* this is reserved for local node */
+ if (g_cluster.localNode->pgpool_node_id == nodeID)
{
wdNode = g_cluster.localNode;
}
/* add the array */
jw_start_array(jNode, "WatchdogNodes");
- if (id == 0)
+ if (id == g_cluster.localNode->pgpool_node_id)
{
/* add the local node info */
add_nodeinfo_to_json(jNode, g_cluster.localNode);
continue;
node->nodeState = NODE_DEAD;
/* It's me! */
- if (i == 0)
+ if (i == pool_config->pgpool_node_id)
inform_node_status(node, "parent process is dead");
else
inform_node_status(node, "unable to connect to node");