[pacemaker] Update to new upstream version - 1.1.5
Andrew Beekhof
beekhof at fedoraproject.org
Wed Apr 27 10:15:13 UTC 2011
commit 15942e40af044748e9369978dddccd011aa5a400
Author: Andrew Beekhof <andrew at beekhof.net>
Date: Wed Apr 27 09:30:30 2011 +0200
Update to new upstream version - 1.1.5
.gitignore | 1 +
bug-lf-2401.patch | 40 ---------------
cman-disconnect.patch | 67 +++++++++++++++++++++++++
cman-dispatch-all.patch | 20 ++++++++
cman-fencing-ack.patch | 31 ++++++++++++
cman-fencing-override.patch | 102 +++++++++++++++++++++++++++++++++++++++
doc-validation.patch | 13 -----
pacemaker-multilib-header.patch | 23 +++++++++
pacemaker.spec | 36 ++++++++++++--
sources | 2 +-
stonith-manpage.patch | 27 ++++++++++
11 files changed, 303 insertions(+), 59 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index c1e8984..e60daa8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/Pacemaker-1.1.4.tar.bz2
+/Pacemaker-1.1.5.tar.bz2
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 <andrew at beekhof.net>
+# 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 <crm/pengine/rules.h>
+ #include <crm/common/cluster.h>
++#include "../lib/common/stack.h"
+
+ #include <crmd.h>
+ #include <crmd_fsa.h>
+@@ -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 <simone.gotti at gmail.com>
+# 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 <simone.gotti at gmail.com>
+# 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 <andrew at beekhof.net>
+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 <andrew at beekhof.net>
+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/pacemaker.spec b/pacemaker.spec
index 5b50f65..004de28 100644
--- a/pacemaker.spec
+++ b/pacemaker.spec
@@ -20,8 +20,8 @@
# We generate some docs using Publican, but its not available everywhere
%bcond_with publican
-%global specversion 5
-%global upstream_version Pacemaker-1.1.4
+%global specversion 1
+%global upstream_version Pacemaker-1.1.5
%global upstream_prefix Pacemaker-1-1-
# Keep around for when/if required
@@ -39,12 +39,19 @@
Name: pacemaker
Summary: Scalable High-Availability cluster resource manager
-Version: 1.1.4
-Release: %{pcmk_release}.1
+Version: 1.1.5
+Release: %{pcmk_release}
License: GPLv2+ and LGPLv2+
Url: http://www.clusterlabs.org
Group: System Environment/Daemons
Source0: http://hg.clusterlabs.org/pacemaker/1.1/archive/%{upstream_version}.tar.bz2
+Patch3: cman-fencing-ack.patch
+Patch4: cman-dispatch-all.patch
+Patch5: cman-disconnect.patch
+Patch6: cman-fencing-override.patch
+Patch7: pacemaker-multilib-header.patch
+Patch8: stonith-manpage.patch
+
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
AutoReqProv: on
Requires(pre): cluster-glue
@@ -57,7 +64,7 @@ BuildRequires: glib2-devel cluster-glue-libs-devel libxml2-devel libxslt-devel
BuildRequires: pkgconfig python-devel gcc-c++ bzip2-devel gnutls-devel pam-devel
# Enables optional functionality
-BuildRequires: help2man ncurses-devel openssl-devel libselinux-devel
+BuildRequires: help2man ncurses-devel openssl-devel libselinux-devel docbook-style-xsl resource-agents
%if %{with esmtp}
BuildRequires: libesmtp-devel
@@ -169,6 +176,12 @@ resource health.
%prep
%setup -q -n %{upstream_prefix}%{upstream_version}
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
%build
./autogen.sh
@@ -182,6 +195,7 @@ resource health.
%{?with_profiling: --with-profiling} \
%{?with_gcov: --with-gcov} \
%{?with_tracedata --with-tracedata} \
+ --with-version=%{version}-%{release} \
--docdir=%{pcmk_docdir} \
--localstatedir=%{_var} \
--with-initdir=%{_initddir} \
@@ -220,6 +234,15 @@ rm -f %{buildroot}/usr/lib/ocf/resource.d/pacemaker/pingd
%clean
rm -rf %{buildroot}
+%post
+/sbin/chkconfig --add pacemaker || :
+
+%preun
+if [ $1 -eq 0 ]; then
+ /sbin/service pacemaker stop &>/dev/null || :
+ /sbin/chkconfig --del pacemaker || :
+fi
+
%post -n pacemaker-libs -p /sbin/ldconfig
%postun -n pacemaker-libs -p /sbin/ldconfig
@@ -318,6 +341,9 @@ rm -rf %{buildroot}
%doc AUTHORS
%changelog
+* Wed Apr 27 2011 Andrew Beekhof <andrew at beekhof.net> 1.1.5-1
+- New upstream release plus patches for CMAN integration
+
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.1.4-5.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
diff --git a/sources b/sources
index f555f9d..559c69b 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-70cd738910eb657b7d8910edd509ebf5 Pacemaker-1.1.4.tar.bz2
+131c5fbf0adf3e34324198f139f2e8ea Pacemaker-1.1.5.tar.bz2
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 $<
More information about the scm-commits
mailing list