diff --git a/cman-disconnect.patch b/cman-disconnect.patch new file mode 100644 index 0000000..c92477d --- /dev/null +++ b/cman-disconnect.patch @@ -0,0 +1,67 @@ +exporting patch: +# HG changeset patch +# User Andrew Beekhof +# Date 1300351285 -3600 +# Node ID 2916bb5363e14eb130be3658faac77b58a61b600 +# Parent f3a9f8559c10b1c53b9c09f1d439194fe47f0fcb +High: ais: Correctly disconnect from Corosync and Cman based clusters + +diff -r f3a9f8559c10 -r 2916bb5363e1 crmd/control.c +--- a/crmd/control.c Thu Mar 17 09:44:08 2011 +0100 ++++ b/crmd/control.c Thu Mar 17 09:41:25 2011 +0100 +@@ -26,6 +26,7 @@ + + #include + #include ++#include "../lib/common/stack.h" + + #include + #include +@@ -65,7 +66,9 @@ do_ha_control(long long action, + if(action & A_HA_DISCONNECT) { + if(is_openais_cluster()) { + crm_peer_destroy(); ++ terminate_ais_connection(); + crm_info("Disconnected from OpenAIS"); ++ + #if SUPPORT_HEARTBEAT + } else if(fsa_cluster_conn != NULL) { + set_bit_inplace(fsa_input_register, R_HA_DISCONNECTED); +diff -r f3a9f8559c10 -r 2916bb5363e1 lib/common/ais.c +--- a/lib/common/ais.c Thu Mar 17 09:44:08 2011 +0100 ++++ b/lib/common/ais.c Thu Mar 17 09:41:25 2011 +0100 +@@ -408,23 +408,23 @@ void terminate_ais_connection(void) + /* G_main_del_fd(ais_source); */ + /* G_main_del_fd(ais_source_sync); */ + ++ if(is_classic_ais_cluster() == FALSE) { ++ coroipcc_service_disconnect(ais_ipc_handle); ++ ++ } else { ++ cpg_leave(pcmk_cpg_handle, &pcmk_cpg_group); ++ } ++ ++ if(is_corosync_cluster()) { ++ quorum_finalize(pcmk_quorum_handle); ++ } ++ + #ifdef SUPPORT_CMAN + if(is_cman_cluster()) { + cman_stop_notification(pcmk_cman_handle); + cman_finish(pcmk_cman_handle); + } + #endif +- +- if(is_corosync_cluster()) { +- quorum_finalize(pcmk_quorum_handle); +- } +- +- if(is_classic_ais_cluster() == FALSE) { +- coroipcc_service_disconnect(ais_ipc_handle); +- +- } else { +- cpg_leave(pcmk_cpg_handle, &pcmk_cpg_group); +- } + } + + int ais_membership_timer = 0; diff --git a/cman-dispatch-all.patch b/cman-dispatch-all.patch new file mode 100644 index 0000000..6f41ece --- /dev/null +++ b/cman-dispatch-all.patch @@ -0,0 +1,20 @@ +# HG changeset patch +# User Simone Gotti +# Date 1300021055 -3600 +# Node ID 8d31ac8a5aede2df525786802b24658d73748ba4 +# Parent d0472a26eda1394c22553d6d6e8f4e0321905192 +Dequeue all the cman emitted events and not only the first one leaving the others in the event's queue. +This fixes a nasty bug that will led to a wrong quorum view in pacemaker. + +diff -r d0472a26eda1 -r 8d31ac8a5aed lib/common/ais.c +--- a/lib/common/ais.c Thu Mar 10 18:55:40 2011 +0100 ++++ b/lib/common/ais.c Sun Mar 13 13:57:35 2011 +0100 +@@ -626,7 +626,7 @@ + + static gboolean pcmk_cman_dispatch(int sender, gpointer user_data) + { +- int rc = cman_dispatch(pcmk_cman_handle, CMAN_DISPATCH_ONE); ++ int rc = cman_dispatch(pcmk_cman_handle, CMAN_DISPATCH_ALL); + if(rc < 0) { + crm_err("Connection to cman failed: %d", rc); + return FALSE; diff --git a/cman-fencing-ack.patch b/cman-fencing-ack.patch new file mode 100644 index 0000000..db51592 --- /dev/null +++ b/cman-fencing-ack.patch @@ -0,0 +1,31 @@ +# HG changeset patch +# User Simone Gotti +# Date 1300116230 -3600 +# Node ID d44150124273e6da61566e89f90b99a2ce276d86 +# Parent 8d31ac8a5aede2df525786802b24658d73748ba4 +Don't call fenced_join and fenced_leave. + +These functions are used to ask fenced to join and leave a domain and not to connect to fenced. +The connection to fenced is already handled by fenced_external. + +diff -r 8d31ac8a5aed -r d44150124273 crmd/te_utils.c +--- a/crmd/te_utils.c Sun Mar 13 13:57:35 2011 +0100 ++++ b/crmd/te_utils.c Mon Mar 14 16:23:50 2011 +0100 +@@ -151,17 +151,10 @@ tengine_stonith_notify(stonith_t *st, co + char *target_copy = crm_strdup(target); + crm_info("Notifing CMAN that '%s' is now fenced", target); + +- rc = fenced_join(); +- if(rc != 0) { +- crm_notice("Could not connect to fenced: rc=%d", rc); +- +- } else { + rc = fenced_external(target_copy); + if(rc != 0) { + crm_err("Could not notify fenced: rc=%d", rc); + } +- fenced_leave(); +- } + crm_free(target_copy); + } + #endif diff --git a/cman-fencing-override.patch b/cman-fencing-override.patch new file mode 100644 index 0000000..ab75613 --- /dev/null +++ b/cman-fencing-override.patch @@ -0,0 +1,102 @@ +changeset: 10609:8e50dc3e0d06 +user: Andrew Beekhof +date: Fri Mar 18 17:12:18 2011 +0100 +files: crmd/te_utils.c +description: +High: cman: Correctly override existing fenced operations + + +diff -r b4f456380f60 -r 8e50dc3e0d06 crmd/te_utils.c +--- a/crmd/te_utils.c Thu Mar 17 09:41:25 2011 +0100 ++++ b/crmd/te_utils.c Fri Mar 18 17:12:18 2011 +0100 +@@ -146,17 +146,32 @@ tengine_stonith_notify(stonith_t *st, co + } + + #ifdef SUPPORT_CMAN +- if(rc == stonith_ok && is_cman_cluster()) { +- int rc = 0; ++ if(rc == stonith_ok && is_cman_cluster()) { ++ int local_rc = 0; ++ FILE *confirm = NULL; + char *target_copy = crm_strdup(target); +- crm_info("Notifing CMAN that '%s' is now fenced", target); + +- rc = fenced_external(target_copy); +- if(rc != 0) { +- crm_err("Could not notify fenced: rc=%d", rc); ++ /* In case fenced hasn't noticed yet */ ++ local_rc = fenced_external(target_copy); ++ if(local_rc != 0) { ++ crm_err("Could not notify CMAN that '%s' is now fenced: %d", target, local_rc); ++ } else { ++ crm_notice("Notified CMAN that '%s' is now fenced", target); ++ } ++ ++ /* In case fenced is already trying to shoot it */ ++ confirm = fopen("/var/run/cluster/fenced_override", "w"); ++ if(confirm) { ++ local_rc = fprintf(confirm, "%s\n", target_copy); ++ if(local_rc < strlen(target_copy)) { ++ crm_err("Confirmation of CMAN fencing event for '%s' failed: %d", target, local_rc); ++ } else { ++ crm_notice("Confirmed CMAN fencing event for '%s'", target); + } +- crm_free(target_copy); +- } ++ fflush(confirm); ++ fclose(confirm); ++ } ++ } + #endif + + if(rc == stonith_ok && safe_str_eq(target, origin)) { +changeset: 10610:c6a01b02950b +tag: master +tag: tip +user: Andrew Beekhof +date: Sat Mar 19 10:50:21 2011 +0100 +files: mcp/corosync.c mcp/pacemaker.c mcp/pacemaker.h +description: +High: cman: We need to run the crmd as root for CMAN so that we can ACK fencing operations + + +diff -r 8e50dc3e0d06 -r c6a01b02950b mcp/corosync.c +--- a/mcp/corosync.c Fri Mar 18 17:12:18 2011 +0100 ++++ b/mcp/corosync.c Sat Mar 19 10:50:21 2011 +0100 +@@ -641,6 +641,7 @@ gboolean read_config(void) + if(safe_str_eq("quorum_cman", value)) { + #ifdef SUPPORT_CMAN + setenv("HA_cluster_type", "cman", 1); ++ enable_crmd_as_root(TRUE); + use_cman = TRUE; + #else + crm_err("Corosync configured for CMAN but this build of Pacemaker doesn't support it"); +diff -r 8e50dc3e0d06 -r c6a01b02950b mcp/pacemaker.c +--- a/mcp/pacemaker.c Fri Mar 18 17:12:18 2011 +0100 ++++ b/mcp/pacemaker.c Sat Mar 19 10:50:21 2011 +0100 +@@ -79,6 +79,15 @@ static pcmk_child_t pcmk_children[] = { + + static gboolean start_child(pcmk_child_t *child); + ++void enable_crmd_as_root(gboolean enable) ++{ ++ if(enable) { ++ pcmk_children[pcmk_child_crmd].uid = NULL; ++ } else { ++ pcmk_children[pcmk_child_crmd].uid = CRM_DAEMON_USER; ++ } ++} ++ + void enable_mgmtd(gboolean enable) + { + if(enable) { +diff -r 8e50dc3e0d06 -r c6a01b02950b mcp/pacemaker.h +--- a/mcp/pacemaker.h Fri Mar 18 17:12:18 2011 +0100 ++++ b/mcp/pacemaker.h Sat Mar 19 10:50:21 2011 +0100 +@@ -57,4 +57,5 @@ extern gboolean update_node_processes(ui + + extern char *get_local_node_name(void); + extern void enable_mgmtd(gboolean enable); ++extern void enable_crmd_as_root(gboolean enable); + + diff --git a/pacemaker-multilib-header.patch b/pacemaker-multilib-header.patch new file mode 100644 index 0000000..3784836 --- /dev/null +++ b/pacemaker-multilib-header.patch @@ -0,0 +1,23 @@ +diff -r c6a01b02950b include/crm_config.h.in +--- a/include/crm_config.h.in Sat Mar 19 10:50:21 2011 +0100 ++++ b/include/crm_config.h.in Fri Mar 25 18:34:59 2011 +0100 +@@ -36,9 +36,6 @@ + /* Where to keep CIB configuration files */ + #undef CRM_CONFIG_DIR + +-/* Location for Pacemaker daemons */ +-#undef CRM_DAEMON_DIR +- + /* Group to run Pacemaker daemons as */ + #undef CRM_DAEMON_GROUP + +@@ -69,9 +66,6 @@ + /* Compatability alias for SUPPORT_COROSYNC */ + #undef AIS_COROSYNC + +-/* Correct printf format for logging uint64_t */ +-#undef U64T +- + /* Use g_hash_table compatibility functions */ + #undef USE_GHASH_COMPAT + diff --git a/stonith-manpage.patch b/stonith-manpage.patch new file mode 100644 index 0000000..20416f2 --- /dev/null +++ b/stonith-manpage.patch @@ -0,0 +1,27 @@ +diff -r 39bbb85636f1 fencing/Makefile.am +--- a/fencing/Makefile.am Tue Apr 26 09:43:57 2011 +0200 ++++ b/fencing/Makefile.am Wed Apr 27 12:00:39 2011 +0200 +@@ -26,14 +26,19 @@ halib_PROGRAMS = stonithd stonith-test + sbin_PROGRAMS = stonith_admin + sbin_SCRIPTS = fence_legacy + +-if BUILD_HELP +-man8_MANS = $(sbin_PROGRAMS:%=%.8) fence_legacy.8 stonithd.8 ++man8_MANS = ++ ++if BUILD_XML_HELP ++man8_MANS += stonithd.8 + stonithd.xml: stonithd +- $(top_builddir)/fencing/$< metadata | $(XSLTPROC) --nonet --novalid --stringparam man.name $< $(top_srcdir)/xml/ocf-meta2man.xsl - > $(top_builddir)/crmd/$@ ++ $(top_builddir)/fencing/$< metadata | $(XSLTPROC) --nonet --novalid --stringparam man.name $< $(top_srcdir)/xml/ocf-meta2man.xsl - > $(top_builddir)/fencing/$@ + + stonithd.8: stonithd.xml +- $(XSLTPROC) $(MANPAGE_XSLT) $(top_builddir)/crmd/$< ++ $(XSLTPROC) $(MANPAGE_XSLT) $(top_builddir)/fencing/$< ++endif + ++if BUILD_HELP ++man8_MANS += $(sbin_PROGRAMS:%=%.8) fence_legacy.8 + %.8: % + echo Creating $@ + chmod a+x $<