]> git.proxmox.com Git - mirror_corosync.git/commitdiff
votequorum: fix expected votes manual override from quorumtools
authorFabio M. Di Nitto <fdinitto@redhat.com>
Fri, 3 Feb 2012 08:45:08 +0000 (09:45 +0100)
committerFabio M. Di Nitto <fdinitto@redhat.com>
Fri, 3 Feb 2012 09:33:33 +0000 (10:33 +0100)
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 <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
exec/votequorum.c

index faa1bf6642e154f8dc1f689e15412f89278d7efc..5f37980c4ec8763aea9f71f023cc35d4e6fa82e0 100644 (file)
@@ -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;