cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [RFC PATCH] dlm: enhancing dlm_controld (pcmk) to be able to handle redundant rings
@ 2009-10-14 10:50 Jiaju Zhang
  2009-10-14 13:28 ` [Cluster-devel] " Jiaju Zhang
  2009-10-14 18:17 ` David Teigland
  0 siblings, 2 replies; 9+ messages in thread
From: Jiaju Zhang @ 2009-10-14 10:50 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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>

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-10-16 10:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-14 10:50 [Cluster-devel] [RFC PATCH] dlm: enhancing dlm_controld (pcmk) to be able to handle redundant rings Jiaju Zhang
2009-10-14 13:28 ` [Cluster-devel] " 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

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).