Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=b1a... Commit: b1ac9397a2e27c2862cf41df7ac523c9982b65cf Parent: 18c497671e3d6ae5aeba0eab3c7bdf7cc50d3612 Author: Christine Caulfield ccaulfie@redhat.com AuthorDate: Tue Oct 20 16:22:31 2009 +0100 Committer: Christine Caulfield ccaulfie@redhat.com CommitterDate: Tue Oct 20 16:22:31 2009 +0100
cman: make quorum_dev_poll default to totem.token
The default value of quorum_dev_poll should always be the same as the totem token timeout, a quorum device is a 'node' after all. A lot of people don't know about this and will happily change token without changing quorum_dev_poll which can have, er, bad side-effects.
This patch simply defaults quorum_dev_poll to to totem.token. It can still be overridden if required.
Signed-off-by: Christine Caulfield ccaulfie@redhat.com --- cman/daemon/ais.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/cman/daemon/ais.c b/cman/daemon/ais.c index 45df5d3..1565510 100644 --- a/cman/daemon/ais.c +++ b/cman/daemon/ais.c @@ -167,7 +167,9 @@ static int cman_exec_init_fn(struct corosync_api_v1 *api) { hdb_handle_t object_handle; hdb_handle_t find_handle; + hdb_handle_t totem_handle; char pipe_msg[256]; + unsigned int totem_token;
corosync = api;
@@ -179,10 +181,19 @@ static int cman_exec_init_fn(struct corosync_api_v1 *api) corosync->object_find_next(find_handle, &cluster_parent_handle); corosync->object_find_destroy(find_handle);
+ /* + * quorum_dev_poll should default to the token timeout so that quorum devices behave + * like nodes + */ + corosync->object_find_create(OBJECT_PARENT_HANDLE, "totem", strlen("totem"), &find_handle); + corosync->object_find_next(find_handle, &totem_handle); + objdb_get_int(api, totem_handle, "token", &totem_token, 1000); + corosync->object_find_destroy(find_handle); + corosync->object_find_create(cluster_parent_handle, "cman", strlen("cman"), &find_handle); if (corosync->object_find_next(find_handle, &object_handle) == 0) { - objdb_get_int(api, object_handle, "quorum_dev_poll", &quorumdev_poll, DEFAULT_QUORUMDEV_POLL); + objdb_get_int(api, object_handle, "quorum_dev_poll", &quorumdev_poll, totem_token); objdb_get_int(api, object_handle, "shutdown_timeout", &shutdown_timeout, DEFAULT_SHUTDOWN_TIMEOUT); objdb_get_int(api, object_handle, "ccsd_poll", &ccsd_poll_interval, DEFAULT_CCSD_POLL); objdb_get_int(api, object_handle, "disallowed", &enable_disallowed, DEFAULT_DISALLOWED);
cluster-commits@lists.stg.fedorahosted.org