static uint8_t two_node = 0;
static uint8_t wait_for_all = 0;
+static uint8_t wait_for_all_status = 0;
static uint8_t auto_tie_breaker = 0;
static int lowest_node_id = -1;
static uint8_t last_man_standing = 0;
wait_for_all = 1;
}
+ if (wait_for_all) {
+ wait_for_all_status = 1;
+ }
+
/* Load the library-servicing part of this module */
api->service_link_and_init(api, "corosync_votequorum_iface", 0);
unsigned int patch_version; /* Backwards/forwards compatible */
unsigned int config_version;
unsigned int flags;
- unsigned int wait_for_all;
+ unsigned int wait_for_all_status;
+ unsigned int quorate;
} __attribute__((packed));
/*
* wait for all nodes to show up before granting quorum
*/
- if (wait_for_all) {
+ if ((wait_for_all) && (wait_for_all_status)) {
if (total_votes != us->expected_votes) {
log_printf(LOGSYS_LEVEL_NOTICE,
"Waiting for all cluster members. "
cluster_is_quorate = 0;
return;
}
- wait_for_all = 0;
+ wait_for_all_status = 0;
get_lowest_node_id();
}
cluster_is_quorate = quorate;
+ if (wait_for_all) {
+ if (quorate) {
+ wait_for_all_status = 0;
+ } else {
+ wait_for_all_status = 1;
+ }
+ }
+
if (quorum_change) {
set_quorum(quorum_members, quorum_members_entries,
cluster_is_quorate, &quorum_ringid);
req_exec_quorum_nodeinfo.patch_version = VOTEQUORUM_PATCH_VERSION;
req_exec_quorum_nodeinfo.flags = us->flags;
req_exec_quorum_nodeinfo.first_trans = first_trans;
- req_exec_quorum_nodeinfo.wait_for_all = wait_for_all;
+ req_exec_quorum_nodeinfo.wait_for_all_status = wait_for_all_status;
+ req_exec_quorum_nodeinfo.quorate = cluster_is_quorate;
req_exec_quorum_nodeinfo.header.id = SERVICE_ID_MAKE(VOTEQUORUM_SERVICE, MESSAGE_REQ_EXEC_VOTEQUORUM_NODEINFO);
req_exec_quorum_nodeinfo.header.size = sizeof(req_exec_quorum_nodeinfo);
nodeinfo->patch_version = swab32(nodeinfo->patch_version);
nodeinfo->config_version = swab32(nodeinfo->config_version);
nodeinfo->flags = swab32(nodeinfo->flags);
- nodeinfo->wait_for_all = swab32(nodeinfo->wait_for_all);
+ nodeinfo->wait_for_all_status = swab32(nodeinfo->wait_for_all_status);
+ nodeinfo->quorate = swab32(nodeinfo->quorate);
LEAVE();
}
node->expected_votes = req_exec_quorum_nodeinfo->expected_votes;
node->state = NODESTATE_MEMBER;
- log_printf(LOGSYS_LEVEL_DEBUG, "nodeinfo message: votes: %d, expected: %d wfa: %d\n",
+ log_printf(LOGSYS_LEVEL_DEBUG, "nodeinfo message: votes: %d, expected: %d wfa: %d quorate: %d\n",
req_exec_quorum_nodeinfo->votes,
req_exec_quorum_nodeinfo->expected_votes,
- req_exec_quorum_nodeinfo->wait_for_all);
+ req_exec_quorum_nodeinfo->wait_for_all_status,
+ req_exec_quorum_nodeinfo->quorate);
if ((last_man_standing) && (req_exec_quorum_nodeinfo->votes > 1)) {
log_printf(LOGSYS_LEVEL_WARNING, "Last Man Standing feature is supported only when all"
free(node);
}
- if ((wait_for_all) && (!req_exec_quorum_nodeinfo->wait_for_all)) {
- wait_for_all = 0;
+ if ((wait_for_all) &&
+ (!req_exec_quorum_nodeinfo->wait_for_all_status) &&
+ (req_exec_quorum_nodeinfo->quorate)) {
+ wait_for_all_status = 0;
}
LEAVE();