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

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



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 = "">@@ -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);
     }

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