Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e95... Commit: e95deaf87607f483f4066e2cbc105ffa725ddd05 Parent: c9bbf4f12402c5e38e51e21d38682712c18ab5ee Author: Christine Caulfield ccaulfie@redhat.com AuthorDate: Wed Jun 23 10:28:33 2010 +0100 Committer: Christine Caulfield ccaulfie@redhat.com CommitterDate: Wed Jun 23 10:28:33 2010 +0100
cman: Recalculate expected_votes on a config reload.
Add code to recalculate the expected_votes (and therefore quorum) when the configuration is reloaded. This means that removing a node now properly sets expected_votes down and the cluster remains quorate. It will also raise expected_votes if a node is added.
rhbz#606989
Signed-off-by: Christine Caulfield ccaulfie@redhat.com --- cman/daemon/cmanconfig.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/cman/daemon/cmanconfig.c b/cman/daemon/cmanconfig.c index 4a82525..16ef65f 100644 --- a/cman/daemon/cmanconfig.c +++ b/cman/daemon/cmanconfig.c @@ -45,6 +45,7 @@ int read_cman_nodes(struct corosync_api_v1 *corosync, unsigned int *config_versi int error; unsigned int expected = 0; unsigned int votes = 0; + unsigned int total_votes = 0; hdb_handle_t object_handle; hdb_handle_t nodes_handle; hdb_handle_t find_handle; @@ -102,11 +103,14 @@ int read_cman_nodes(struct corosync_api_v1 *corosync, unsigned int *config_versi log_printf(LOGSYS_LEVEL_DEBUG, "memb: Got node %s from ccs (id=%d, votes=%d)\n", nodename, this_nodeid, votes); add_ccs_node(nodename, this_nodeid, votes, expected); nodes_handle = nodeslist_next(corosync, find_handle); + total_votes += votes; } while (nodes_handle); corosync->object_find_destroy(find_handle);
- if (expected) - override_expected(expected); + if (!expected) + expected = total_votes; + + override_expected(expected);
remove_unread_nodes(); error = 0;