public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: David Teigland <teigland@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: RHEL5 - dlm_controld: add multiple node addresses
Date: Thu, 28 May 2009 16:24:00 -0000	[thread overview]
Message-ID: <20090528162347.E39B9120210@lists.fedorahosted.org> (raw)

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));
+			}
 		}
 	}
 }


                 reply	other threads:[~2009-05-28 16:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090528162347.E39B9120210@lists.fedorahosted.org \
    --to=teigland@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).