static int get_cluster_node_count(void);
static void clear_command_node_result(WDCommandNodeResult* nodeResult);
+static inline bool is_local_node_true_master(void);
static inline WD_STATES get_local_node_state(void);
static int set_state(WD_STATES newState);
static IPC_CMD_PREOCESS_RES process_IPC_failover_command(WDCommandData* ipcCommand)
{
- if (get_local_node_state() == WD_COORDINATOR)
+ if (is_local_node_true_master())
{
ereport(LOG,
(errmsg("watchdog received the failover command from local pgpool-II on IPC interface")));
return IPC_CMD_PROCESSING;
}
}
- else if (get_local_node_state() == WD_COORDINATOR)
+ else if (is_local_node_true_master())
{
/* This node is itself a master node, So send the empty result with OK tag */
return IPC_CMD_OK;
return g_cluster.localNode->state;
}
+static inline bool is_local_node_true_master(void)
+{
+ return (get_local_node_state() == WD_COORDINATOR && WD_MASTER_NODE == g_cluster.localNode);
+}
+
/*
* returns true if no message is swollowed by the
* processor and no further action is required