[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] Re: [RFC PATCH] dlm: enhancing dlm_controld (pcmk) to be able to handle redundant rings



I'd like to resend the patch as attachment since it may have some format problem
when I sent it last time.

Thanks,
Jiaju

On Wed, Oct 14, 2009 at 6:50 PM, Jiaju Zhang <jjzhang linux gmail com> wrote:
Hi,

Since there is no proper way to enable SCTP when using pacemaker stack,
this patch is to auto-enable SCTP when redundant rings have been configured in corosync.
Review and comments are welcome :)

Thanks a lot,
Jiaju

Since there is no proper way to enable SCTP when using pacemaker stack,
this patch is to auto-enable SCTP when redundant rings have been
configured in corosync.
Review and comments are welcome :)

Signed-off-by: Jiaju Zhang <jjzhang linux gmail com>
---

diff -Nupr a/group/dlm_controld/pacemaker.c b/group/dlm_controld/pacemaker.c
--- a/group/dlm_controld/pacemaker.c	2009-10-14 18:00:20.000000000 +0800
+++ b/group/dlm_controld/pacemaker.c	2009-10-14 18:06:52.000000000 +0800
@@ -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, gpoi
 	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, gpoi
 	    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);
     }
 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]