diff --git a/exec/coroparse.c b/exec/coroparse.c index 98e5189d..abbd5128 100644 --- a/exec/coroparse.c +++ b/exec/coroparse.c @@ -368,6 +368,7 @@ static int main_config_parser_cb(const char *path, if ((strcmp(path, "quorum.disallowed") == 0) || (strcmp(path, "quorum.two_node") == 0) || + (strcmp(path, "quorum.wait_for_all") == 0) || (strcmp(path, "quorum.quorate") == 0)) { i = atoi(value); icmap_set_uint8(path, i); diff --git a/services/votequorum.c b/services/votequorum.c index 6d8a603a..3ba59786 100644 --- a/services/votequorum.c +++ b/services/votequorum.c @@ -124,6 +124,7 @@ static int cluster_is_quorate; static int first_trans = 1; static unsigned int quorumdev_poll = DEFAULT_QDEV_POLL; static unsigned int leaving_timeout = DEFAULT_LEAVE_TMO; +static uint8_t wait_for_all = 0; static struct cluster_node *us; static struct cluster_node *quorum_device = NULL; @@ -385,6 +386,8 @@ static void votequorum_init(struct corosync_api_v1 *api, ENTER(); set_quorum = report; + icmap_get_uint8("quorum.wait_for_all", &wait_for_all); + /* Load the library-servicing part of this module */ api->service_link_and_init(api, "corosync_votequorum_iface", 0); @@ -608,6 +611,23 @@ static void set_quorate(int total_votes) int quorate; ENTER(); + + /* + * wait for all nodes to show up before granting quorum + */ + + if (wait_for_all) { + if (total_votes != us->expected_votes) { + log_printf(LOGSYS_LEVEL_NOTICE, + "Waiting for all cluster members. " + "Current votes: %d expected_votes: %d\n", + total_votes, us->expected_votes); + cluster_is_quorate = 0; + return; + } + wait_for_all = 0; + } + if (quorum > total_votes) { quorate = 0; }