Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ce…
Commit: cef3fc9b1c8096a18d61166abb9e5e0eb2fdc1d7
Parent: bc586574bd252be678506cde92629c86b8f17fa8
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue May 15 09:11:34 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue May 15 09:11:34 2012 +0200
dlm_controld: retry connection to corosync if we get a EAGAIN
this change is necessary only at the first api_initialize call to corosync.
corosync 2.0 returns
- CS_ERR_LIBRARY (2) when corosync is not running
- CS_ERR_TRY_AGAIN (6) when corosync has started but it's not ready
to provide services yet (IPC will refuse connections)
- CS_OK once it's ready or other errors for failures.
Resolves: rhbz#816200
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
dlm_controld/member.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/dlm_controld/member.c b/dlm_controld/member.c
index ecdfabc..d195ab1 100644
--- a/dlm_controld/member.c
+++ b/dlm_controld/member.c
@@ -11,6 +11,7 @@
#include <corosync/cfg.h>
#include <corosync/cmap.h>
#include <corosync/quorum.h>
+#include <errno.h>
static corosync_cfg_handle_t ch;
static quorum_handle_t qh;
@@ -295,9 +296,17 @@ int setup_cluster_cfg(void)
cs_error_t err;
unsigned int nodeid;
int fd;
+ int retry = 1;
+try_again:
err = corosync_cfg_initialize(&ch, &cfg_callbacks);
if (err != CS_OK) {
+ if ((err == CS_ERR_TRY_AGAIN) && (retry <= 10)) {
+ log_error("corosync has not completed initialization.. retry %d", retry);
+ sleep(1);
+ retry++;
+ goto try_again;
+ }
log_error("corosync cfg init error %d", err);
return -1;
}
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=fd…
Commit: fda037ad25a058d0fe2a61b6972a5663276d1005
Parent: 10ebf6e26eff7fd21ac245cac9876ef62ae049ca
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue May 15 16:37:13 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue May 15 16:37:13 2012 +0200
cman init: add extra documentation for FENCE_JOIN=""
Related: rhbz#821016
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 3 +++
cman/init.d/cman.init.defaults.in | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index dddfe6e..95323b4 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -135,6 +135,9 @@ fi
# set to "yes", then the script will attempt to join the fence domain.
# If FENCE_JOIN is set to any other value, the default behavior is
# to join the fence domain (equivalent to "yes").
+# When setting FENCE_JOIN to "no", it is important to check
+# DLM_CONTROLD_OPTS to reflect expected behavior regarding fencing
+# and quorum.
[ -z "$FENCE_JOIN" ] && FENCE_JOIN="yes"
# FENCED_OPTS -- allow extra options to be passed to fence daemon.
diff --git a/cman/init.d/cman.init.defaults.in b/cman/init.d/cman.init.defaults.in
index adde8d9..b981bab 100644
--- a/cman/init.d/cman.init.defaults.in
+++ b/cman/init.d/cman.init.defaults.in
@@ -58,6 +58,9 @@
# set to "yes", then the script will attempt to join the fence domain.
# If FENCE_JOIN is set to any other value, the default behavior is
# to join the fence domain (equivalent to "yes").
+# When setting FENCE_JOIN to "no", it is important to check
+# DLM_CONTROLD_OPTS to reflect expected behavior regarding fencing
+# and quorum.
#FENCE_JOIN="yes"
# FENCED_OPTS -- allow extra options to be passed to fence daemon.