Skip to contentSkip to conversation

Don't show offline + estranged members

PATCH New Lon Hohberger 1 participant 1 message Feb 6, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 663105.26031202325901042.JavaMail.root@ottmail

#1 lore raw

PATCH 1/1 Don't show offline + estranged members

This patch prevents the 'clustat' utility from showing members which:

* are not part of the configuration, and
* offline/dead/etc.

-- Lon

Index: clustat.c
===================================================================
RCS file: /cvs/cluster/cluster/rgmanager/src/utils/clustat.c,v retrieving revision 1.38

clustat.c +8 -0
diff -u -r1.38 clustat.c
@@ -719,6 +719,10 @@
 void
 txt_member_state(cman_node_t *node, int nodesize)
 {
+	/* If it's down and not in cluster.conf, don't show it */
+	if ((node->cn_member & (FLAG_NOCFG | FLAG_UP)) == FLAG_NOCFG)
+		return;
+
 	printf(" %-*.*s ", nodesize, nodesize, node->cn_name);
 	printf("%4d ", node->cn_nodeid);
 
@@ -754,6 +758,10 @@
 void
 xml_member_state(cman_node_t *node)
 {
+	/* If it's down and not in cluster.conf, don't show it */
+	if ((node->cn_member & (FLAG_NOCFG | FLAG_UP)) == FLAG_NOCFG)
+		return;
+
 	printf("    <node name=\"%s\" state=\"%d\" local=\"%d\" "
 	       "estranged=\"%d\" rgmanager=\"%d\" rgmanager_master=\"%d\" "
 	       "qdisk=\"%d\" nodeid=\"0x%08x\"/>\n",