From: Jiaju Zhang <jjzhang.linux@gmail.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [RFC PATCH] dlm: enhancing dlm_controld (pcmk) to be able to handle redundant rings
Date: Wed, 14 Oct 2009 18:50:56 +0800 [thread overview]
Message-ID: <f8c992a30910140350m5093ba45k430511b9e23f8cfe@mail.gmail.com> (raw)
Hi,
Since there is no proper way to enable SCTP when using pacemaker stack,
this patch is to auto-enabled SCTP when redundant rings have been configured
in corosync.
Review and comments are welcome :)
Thanks a lot,
Jiaju
diff --git a/group/dlm_controld/pacemaker.c b/group/dlm_controld/pacemaker.c
index 810c644..ed0f958 100644
--- a/group/dlm_controld/pacemaker.c
+++ b/group/dlm_controld/pacemaker.c
@@ -23,6 +23,7 @@
#include <pacemaker/crm/cib.h>
#define COMMS_DIR "/sys/kernel/config/dlm/cluster/comms"
+#define PROTO_SCTP 1
int setup_ccs(void)
{
@@ -78,9 +79,11 @@ int setup_cluster(void)
return ais_fd_async;
}
+/*Force re-read of cluster membership */
void update_cluster(void)
{
static uint64_t last_membership = 0;
+ ais_dispatch(ais_fd_async, NULL);
cluster_quorate = crm_have_quorum;
if(last_membership < crm_peer_seq) {
log_debug("Processing membership %llu", crm_peer_seq);
@@ -91,7 +94,6 @@ void update_cluster(void)
void process_cluster(int ci)
{
- ais_dispatch(ais_fd_async, NULL);
update_cluster();
}
@@ -141,6 +143,7 @@ void dlm_process_node(gpointer key, gpointer value,
gpointer user_data)
char *addr_copy = strdup(node->addr);
char *addr_top = addr_copy;
char *addr = NULL;
+ int count = 0;
if(do_remove) {
action = "Re-added";
@@ -207,7 +210,13 @@ void dlm_process_node(gpointer key, gpointer value,
gpointer user_data)
log_debug("Adding address %s to configfs for node %u/%s ", addr,
node->id, node->uname);
add_configfs_node(node->id, ((char*)&cna_addr), cna_len, (node->id
== local_node_id));
+ count++;
+
} while(addr != NULL);
+
+ if (count > 1)
+ cfgk_protocol = PROTO_SCTP;
+
free(addr_top);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20091014/ea122030/attachment.htm>
next reply other threads:[~2009-10-14 10:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 10:50 Jiaju Zhang [this message]
2009-10-14 13:28 ` [Cluster-devel] Re: [RFC PATCH] dlm: enhancing dlm_controld (pcmk) to be able to handle redundant rings Jiaju Zhang
2009-10-14 18:17 ` David Teigland
2009-10-15 5:34 ` Jiaju Zhang
2009-10-15 7:43 ` Andrew Beekhof
2009-10-15 14:51 ` David Teigland
2009-10-15 15:30 ` Andrew Beekhof
2009-10-15 16:07 ` Jiaju Zhang
2009-10-16 10:17 ` Lars Marowsky-Bree
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=f8c992a30910140350m5093ba45k430511b9e23f8cfe@mail.gmail.com \
--to=jjzhang.linux@gmail.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 NNTP newsgroup(s).