From 3b77dd9d833081c7b7fb8f0398ad2f75fdf3e0ea Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Fri, 3 Feb 2012 09:45:08 +0100 Subject: [PATCH] votequorum: fix expected votes manual override from quorumtools votequorum internal quorum/expected_vote check was slightly too conservative and was not done correctly when leave_remove feature is enabled. this fix allows admins to effectively override expected_votes and drive ev_barrier as expected. Signed-off-by: Fabio M. Di Nitto Reviewed-by: Christine Caulfield --- exec/votequorum.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/exec/votequorum.c b/exec/votequorum.c index faa1bf66..5f37980c 100644 --- a/exec/votequorum.c +++ b/exec/votequorum.c @@ -1166,8 +1166,7 @@ static void message_handler_req_exec_votequorum_reconfigure ( case VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES: list_iterate(nodelist, &cluster_members_list) { node = list_entry(nodelist, struct cluster_node, list); - if (node->state == NODESTATE_MEMBER && - node->expected_votes > req_exec_quorum_reconfigure->value) { + if (node->state == NODESTATE_MEMBER) { node->expected_votes = req_exec_quorum_reconfigure->value; } } @@ -1497,13 +1496,18 @@ static void message_handler_req_lib_votequorum_setexpected (void *conn, const vo cs_error_t error = CS_OK; unsigned int newquorum; unsigned int total_votes; + uint8_t leave_remove_status = 0; ENTER(); + leave_remove_status = leave_remove; + leave_remove = 0; + /* * Validate new expected votes */ newquorum = calculate_quorum(1, req_lib_votequorum_setexpected->expected_votes, &total_votes); + leave_remove = leave_remove_status; if (newquorum < total_votes / 2 || newquorum > total_votes) { error = CS_ERR_INVALID_PARAM; -- 2.39.5