public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL5 - dlm_controld: add multiple node addresses
@ 2009-05-28 16:24 David Teigland
  0 siblings, 0 replies; only message in thread
From: David Teigland @ 2009-05-28 16:24 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0c9e7d2a297729c6ebfc3b0166081f6f1fffc1c8
Commit:        0c9e7d2a297729c6ebfc3b0166081f6f1fffc1c8
Parent:        958bac9a2e8938fb743b89d268c765cb020b30f0
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Fri May 22 11:10:19 2009 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Thu May 28 11:15:39 2009 -0500

dlm_controld: add multiple node addresses

Add multi-path capability. Each address we get from cman is now
passed into the DLM.

It's still incumbent on cluster.conf to set the transport to sctp.

STABLE2 commit 72e748656e9df26fb0d0983fe158f96599b76e06
has existed for a long time.

Signed-off-by: David Teigland <teigland@redhat.com>
---
 group/dlm_controld/dlm_daemon.h  |    1 +
 group/dlm_controld/member_cman.c |   26 ++++++++++++++++++++------
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/group/dlm_controld/dlm_daemon.h b/group/dlm_controld/dlm_daemon.h
index b95e176..c164a81 100644
--- a/group/dlm_controld/dlm_daemon.h
+++ b/group/dlm_controld/dlm_daemon.h
@@ -56,6 +56,7 @@
 #define MAXCON		4
 #define MAXNAME		255
 #define MAX_NODES	256 /* should be same as MAX_GROUP_MEMBERS */
+#define MAX_NODE_ADDRESSES 4
 
 extern char *prog_name;
 extern int daemon_debug_opt;
diff --git a/group/dlm_controld/member_cman.c b/group/dlm_controld/member_cman.c
index 53ba72f..1ce180c 100644
--- a/group/dlm_controld/member_cman.c
+++ b/group/dlm_controld/member_cman.c
@@ -68,7 +68,10 @@ char *nodeid2name(int nodeid)
 
 static void statechange(void)
 {
-	int i, rv;
+	int i, j, rv;
+	struct cman_node_address addrs[MAX_NODE_ADDRESSES];
+	int num_addrs;
+	struct cman_node_address *addrptr = addrs;
 
 	old_node_count = cman_node_count;
 	memcpy(&old_nodes, &cman_nodes, sizeof(old_nodes));
@@ -104,14 +107,25 @@ static void statechange(void)
 		if (cman_nodes[i].cn_member &&
 		    !is_old_member(cman_nodes[i].cn_nodeid)) {
 
+			rv = cman_get_node_addrs(ch, cman_nodes[i].cn_nodeid,
+						 MAX_NODE_ADDRESSES,
+						 &num_addrs, addrs);
+			if (rv < 0) {
+				log_debug("cman_get_node_addrs failed, falling back to single-homed. ");
+				num_addrs = 1;
+				addrptr = &cman_nodes[i].cn_address;
+			}
+
 			log_debug("cman: node %d added",
 				  cman_nodes[i].cn_nodeid);
 
-			add_configfs_node(cman_nodes[i].cn_nodeid,
-					  cman_nodes[i].cn_address.cna_address,
-					  cman_nodes[i].cn_address.cna_addrlen,
-					  (cman_nodes[i].cn_nodeid ==
-					   our_nodeid));
+			for (j = 0; j < num_addrs; j++) {
+				add_configfs_node(cman_nodes[i].cn_nodeid,
+						  addrptr[j].cna_address,
+						  addrptr[j].cna_addrlen,
+						  (cman_nodes[i].cn_nodeid ==
+						   our_nodeid));
+			}
 		}
 	}
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-28 16:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-28 16:24 cluster: RHEL5 - dlm_controld: add multiple node addresses David Teigland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).