Gitweb:
http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=b4408e05096...
Commit: b4408e050960c35793afb33b6c589bf579252609
Parent: 3e4cddfa54bf3e5dcc2e94343df54dc15539138c
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Tue Aug 13 16:32:38 2013 +0100
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Tue Aug 13 16:32:38 2013 +0100
qdisk: Check that all nodes are running qdiskd and warn if not
At every cman poll, qdiskd now asks cman not only whether the
node is up, but also whether it it running a qdiskd. (more
accurately, it asks if anything is bound to the qdiskd
cman port). If any node is active in cman but NOT running
qdiskd then a warning is printed to syslog every 5 seconds.
rhbz#994187
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
Acked-By: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/qdisk/main.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index 4d4397a..9dee134 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -632,6 +632,7 @@ check_cman(qd_ctx *ctx, memb_mask_t mask, memb_mask_t master_mask)
{
cman_node_t nodes[MAX_NODES_DISK];
int retnodes, x;
+ static unsigned int check_cycle = 0;
if (cman_get_nodes(ctx->qc_cman_admin, MAX_NODES_DISK,
&retnodes, nodes) <0 )
@@ -639,6 +640,18 @@ check_cman(qd_ctx *ctx, memb_mask_t mask, memb_mask_t master_mask)
memset(master_mask, 0, sizeof(memb_mask_t));
for (x = 0; x < retnodes; x++) {
+ /* See if the other node is running cman and not qdiskd.
+ Just to this every 4 times (seconds) so we don't spam syslog
+ too much. cman_is_listening() can return EBUSY which means
+ "I don't know". We don't worry about this, and just report
+ at the next check by which time it will.
+ */
+ check_cycle = (check_cycle + 1) % 4;
+ if ((check_cycle == 1) &&
+ (cman_is_listening(ctx->qc_cman_admin, nodes[x].cn_nodeid,
+ CLUSTER_PORT_QDISKD) == 0)) {
+ logt_print(LOG_NOTICE, "node %s is up but not running qdiskd",
nodes[x].cn_name);
+ }
if (is_bit_set(mask, nodes[x].cn_nodeid-1, sizeof(memb_mask_t)) &&
nodes[x].cn_member) {
set_bit(master_mask, nodes[x].cn_nodeid-1,