summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2006-09-17 22:48:05 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2006-09-17 22:48:05 +0000
commit8322fcc0b7568b8b2251c9cf101387d83a177ecd (patch)
treefe27162d586dbf63a7e9e3383930f191f80e0484 /sys-cluster
parentUpdate to final 1.4.0 release. (diff)
downloadgentoo-2-8322fcc0b7568b8b2251c9cf101387d83a177ecd.tar.gz
gentoo-2-8322fcc0b7568b8b2251c9cf101387d83a177ecd.tar.bz2
gentoo-2-8322fcc0b7568b8b2251c9cf101387d83a177ecd.zip
Update resource failcount in all required cases, fixed bug #147435.
(Portage version: 2.1-r1)
Diffstat (limited to 'sys-cluster')
-rw-r--r--sys-cluster/heartbeat/ChangeLog9
-rw-r--r--sys-cluster/heartbeat/files/digest-heartbeat-2.0.7-r23
-rw-r--r--sys-cluster/heartbeat/files/heartbeat-2.0.7-update-resources-failcount.patch223
-rw-r--r--sys-cluster/heartbeat/heartbeat-2.0.7-r1.ebuild8
-rw-r--r--sys-cluster/heartbeat/heartbeat-2.0.7-r2.ebuild119
5 files changed, 354 insertions, 8 deletions
diff --git a/sys-cluster/heartbeat/ChangeLog b/sys-cluster/heartbeat/ChangeLog
index 5d8e569a3641..e40b59a7853e 100644
--- a/sys-cluster/heartbeat/ChangeLog
+++ b/sys-cluster/heartbeat/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-cluster/heartbeat
# Copyright 2000-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/heartbeat/ChangeLog,v 1.56 2006/09/17 22:38:42 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/heartbeat/ChangeLog,v 1.57 2006/09/17 22:48:05 xmerlin Exp $
+
+*heartbeat-2.0.7-r2 (17 Sep 2006)
+
+ 17 Sep 2006; Christian Zoffoli <xmerlin@gentoo.org>
+ +files/heartbeat-2.0.7-update-resources-failcount.patch,
+ heartbeat-2.0.7-r1.ebuild, +heartbeat-2.0.7-r2.ebuild:
+ Update resource failcount in all required cases, fixed bug #147435.
17 Sep 2006; Christian Zoffoli <xmerlin@gentoo.org>
-files/heartbeat-1.2.3-lvm.patch,
diff --git a/sys-cluster/heartbeat/files/digest-heartbeat-2.0.7-r2 b/sys-cluster/heartbeat/files/digest-heartbeat-2.0.7-r2
new file mode 100644
index 000000000000..8ff7ae56cec2
--- /dev/null
+++ b/sys-cluster/heartbeat/files/digest-heartbeat-2.0.7-r2
@@ -0,0 +1,3 @@
+MD5 41233e5097c42341bf2162806d4cb99c heartbeat-2.0.7.tar.gz 3327126
+RMD160 8fe70e64fc6714fef4e501ae0b240d870a51cf75 heartbeat-2.0.7.tar.gz 3327126
+SHA256 008214f51fd0c49e168d1bb262cb5c967bc166f99d0c8ff3a2623c8ba51a0ab3 heartbeat-2.0.7.tar.gz 3327126
diff --git a/sys-cluster/heartbeat/files/heartbeat-2.0.7-update-resources-failcount.patch b/sys-cluster/heartbeat/files/heartbeat-2.0.7-update-resources-failcount.patch
new file mode 100644
index 000000000000..cd1e563bac53
--- /dev/null
+++ b/sys-cluster/heartbeat/files/heartbeat-2.0.7-update-resources-failcount.patch
@@ -0,0 +1,223 @@
+--- a/crm/tengine/events.c Wed Sep 06 11:40:40 2006 +0200
++++ b/crm/tengine/events.c Tue Sep 12 18:17:10 2006 +0200
+@@ -198,51 +198,81 @@ extract_event(crm_data_t *msg)
+ }
+
+ static void
+-update_failcount(crm_action_t *action, int rc)
+-{
+- crm_data_t *rsc = NULL;
++update_failcount(crm_data_t *event, const char *event_node, int rc)
++{
+ char *attr_name = NULL;
+
+- const char *task = NULL;
+- const char *rsc_id = NULL;
+- const char *on_node = NULL;
+- const char *on_uuid = NULL;
+- const char *interval = NULL;
++ char *task = NULL;
++ char *rsc_id = NULL;
++ const char *on_node = event_node;
++ const char *on_uuid = event_node;
++ int interval = 0;
+
+ if(rc == 99) {
+ /* this is an internal code for "we're busy, try again" */
+ return;
+ }
+
+- interval = g_hash_table_lookup(
+- action->params, crm_meta_name("interval"));
+- if(interval == NULL) {
+- return;
+- }
+-
+- CRM_CHECK(action->xml != NULL, return);
+-
+- rsc = find_xml_node(action->xml, XML_CIB_TAG_RESOURCE, TRUE);
+- CRM_CHECK(rsc != NULL, return);
+- rsc_id = ID(rsc);
+- CRM_CHECK(rsc_id != NULL, return);
+-
+- task = crm_element_value(action->xml, XML_LRM_ATTR_TASK);
+- on_node = crm_element_value(action->xml, XML_LRM_ATTR_TARGET);
+- on_uuid = crm_element_value(action->xml, XML_LRM_ATTR_TARGET_UUID);
+-
+- CRM_CHECK(task != NULL, return);
+ CRM_CHECK(on_uuid != NULL, return);
+- CRM_CHECK(on_node != NULL, return);
+-
+- attr_name = crm_concat("fail-count", rsc_id, '-');
+- crm_warn("Updating failcount for %s on %s after failed %s: rc=%d",
+- rsc_id, on_node, task, rc);
+-
+- update_attr(te_cib_conn, cib_none, XML_CIB_TAG_STATUS,
+- on_uuid, NULL,NULL, attr_name, XML_NVPAIR_ATTR_VALUE"++");
+-
+- crm_free(attr_name);
++
++ CRM_CHECK(parse_op_key(ID(event), &rsc_id, &task, &interval),return);
++ CRM_CHECK(task != NULL, crm_free(rsc_id); return);
++ CRM_CHECK(rsc_id != NULL, crm_free(task); return);
++ /* CRM_CHECK(on_node != NULL, return); */
++
++ if(interval > 0) {
++ attr_name = crm_concat("fail-count", rsc_id, '-');
++ crm_warn("Updating failcount for %s on %s after failed %s: rc=%d",
++ rsc_id, on_node, task, rc);
++
++ update_attr(te_cib_conn, cib_none, XML_CIB_TAG_STATUS,
++ on_uuid, NULL,NULL, attr_name,
++ XML_NVPAIR_ATTR_VALUE"++");
++ crm_free(attr_name);
++ }
++
++ crm_free(rsc_id);
++ crm_free(task);
++}
++
++static int
++status_from_rc(crm_action_t *action, int orig_status, int rc)
++{
++ int status = orig_status;
++ const char *target_rc_s = g_hash_table_lookup(
++ action->params, crm_meta_name(XML_ATTR_TE_TARGET_RC));
++
++ if(target_rc_s != NULL) {
++ int target_rc = 0;
++ crm_debug_2("Target rc: %s vs. %d", target_rc_s, rc);
++ target_rc = crm_parse_int(target_rc_s, NULL);
++ if(target_rc == rc) {
++ crm_debug_2("Target rc: == %d", rc);
++ if(status != LRM_OP_DONE) {
++ crm_debug_2("Re-mapping op status to"
++ " LRM_OP_DONE for rc=%d", rc);
++ status = LRM_OP_DONE;
++ }
++ } else {
++ crm_debug_2("Target rc: != %d", rc);
++ if(status != LRM_OP_ERROR) {
++ crm_info("Re-mapping op status to"
++ " LRM_OP_ERROR for rc=%d", rc);
++ status = LRM_OP_ERROR;
++ }
++ }
++ }
++
++ /* 99 is the code we use for direct nack's */
++ if(rc != 99 && status != LRM_OP_DONE) {
++ const char *task, *uname;
++ task = crm_element_value(action->xml, XML_LRM_ATTR_TASK);
++ uname = crm_element_value(action->xml, XML_LRM_ATTR_TARGET);
++ crm_warn("Action %s on %s failed (target: %s vs. rc: %d): %s",
++ task, uname, target_rc_s, rc, op_status2text(status));
++ }
++
++ return status;
+ }
+
+ /*
+@@ -255,9 +285,6 @@ match_graph_event(
+ match_graph_event(
+ crm_action_t *action, crm_data_t *event, const char *event_node)
+ {
+- int log_level_fail = LOG_ERR;
+- int target_rc = 0;
+- const char *target_rc_s = NULL;
+ const char *allow_fail = NULL;
+ const char *this_action = NULL;
+ const char *this_node = NULL;
+@@ -296,15 +323,19 @@ match_graph_event(
+ crm_debug_2("Action %d : Node mismatch %s (%s) vs. %s",
+ action->id, this_node, this_uname, event_node);
+ return -1;
+-
+- }
+-
++ }
++
+ crm_debug_2("Matched action (%d) %s", action->id, this_event);
+
+ CRM_CHECK(decode_transition_magic(
+ magic, &update_te_uuid,
+ &transition_i, &op_status_i, &op_rc_i), return -2);
+
++ op_status_i = status_from_rc(action, op_status_i, op_rc_i);
++ if(op_status_i != LRM_OP_DONE) {
++ update_failcount(event, event_node, op_rc_i);
++ }
++
+ if(transition_i == -1) {
+ /* we never expect these - recompute */
+ crm_err("Detected action %s initiated outside of a transition",
+@@ -334,28 +365,6 @@ match_graph_event(
+ /* stop this event's timer if it had one */
+ stop_te_timer(action->timer);
+ action->confirmed = TRUE;
+-
+- target_rc_s = g_hash_table_lookup(
+- action->params,crm_meta_name(XML_ATTR_TE_TARGET_RC));
+- if(target_rc_s != NULL) {
+- crm_debug_2("Target rc: %s vs. %d", target_rc_s, op_rc_i);
+- target_rc = crm_parse_int(target_rc_s, NULL);
+- if(target_rc == op_rc_i) {
+- crm_debug_2("Target rc: == %d", op_rc_i);
+- if(op_status_i != LRM_OP_DONE) {
+- crm_debug_2("Re-mapping op status to"
+- " LRM_OP_DONE for %s",update_event);
+- op_status_i = LRM_OP_DONE;
+- }
+- } else {
+- crm_debug_2("Target rc: != %d", op_rc_i);
+- if(op_status_i != LRM_OP_ERROR) {
+- crm_info("Re-mapping op status to"
+- " LRM_OP_ERROR for %s", update_event);
+- op_status_i = LRM_OP_ERROR;
+- }
+- }
+- }
+
+ /* Process OP status */
+ switch(op_status_i) {
+@@ -371,18 +380,9 @@ match_graph_event(
+ case LRM_OP_DONE:
+ break;
+ case LRM_OP_ERROR:
+- /* This is the code we use for direct nack's */
+- if(op_rc_i == 99) {
+- log_level_fail = LOG_WARNING;
+- }
+- /* fall through */
+ case LRM_OP_TIMEOUT:
+ case LRM_OP_NOTSUPPORTED:
+ action->failed = TRUE;
+- crm_log_maybe(log_level_fail,
+- "Action %s on %s failed (target: %d vs. rc: %d): %s",
+- update_event, this_uname, target_rc,
+- op_rc_i, op_status2text(op_status_i));
+ break;
+ case LRM_OP_CANCELLED:
+ /* do nothing?? */
+@@ -405,10 +405,6 @@ match_graph_event(
+ }
+
+ if(action->failed) {
+- /* ignore probes */
+- if(target_rc != EXECRA_NOT_RUNNING) {
+- update_failcount(action, op_rc_i);
+- }
+ abort_transition(action->synapse->priority+1,
+ tg_restart, "Event failed", event);
+
+@@ -544,6 +540,9 @@ process_graph_event(crm_data_t *event, c
+ /* unexpected event, trigger a pe-recompute */
+ /* possibly do this only for certain types of actions */
+ crm_warn("Event not found.");
++ if(rc != EXECRA_OK) {
++ update_failcount(event, event_node, rc);
++ }
+ crm_log_xml_info(event, "match:not-found");
+ abort_transition(INFINITY, tg_restart, "Unexpected event", event);
+ return;
+
diff --git a/sys-cluster/heartbeat/heartbeat-2.0.7-r1.ebuild b/sys-cluster/heartbeat/heartbeat-2.0.7-r1.ebuild
index d5c371523e74..8290397ae031 100644
--- a/sys-cluster/heartbeat/heartbeat-2.0.7-r1.ebuild
+++ b/sys-cluster/heartbeat/heartbeat-2.0.7-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/heartbeat/heartbeat-2.0.7-r1.ebuild,v 1.1 2006/08/24 16:24:28 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/heartbeat/heartbeat-2.0.7-r1.ebuild,v 1.2 2006/09/17 22:48:05 xmerlin Exp $
inherit flag-o-matic eutils
@@ -43,12 +43,6 @@ DEPEND="
)
"
-src_unpack() {
- unpack ${A}
- cd ${S}
- #epatch ${FILESDIR}/${PN}-2.0.4-fix-local-DOS-attack.patch || die
-}
-
src_compile() {
append-ldflags $(bindnow-flags)
diff --git a/sys-cluster/heartbeat/heartbeat-2.0.7-r2.ebuild b/sys-cluster/heartbeat/heartbeat-2.0.7-r2.ebuild
new file mode 100644
index 000000000000..480c3b1f11e5
--- /dev/null
+++ b/sys-cluster/heartbeat/heartbeat-2.0.7-r2.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/heartbeat/heartbeat-2.0.7-r2.ebuild,v 1.1 2006/09/17 22:48:05 xmerlin Exp $
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Heartbeat high availability cluster manager"
+HOMEPAGE="http://www.linux-ha.org"
+SRC_URI="http://www.linux-ha.org/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 -mips ~ppc -s390 ~x86"
+IUSE="ldirectord doc snmp management"
+
+DEPEND="
+ =dev-libs/glib-2*
+ net-libs/libnet
+ dev-util/pkgconfig
+ >=dev-lang/perl-5.8.8
+ net-misc/iputils
+ virtual/ssh
+ net-libs/gnutls
+ ldirectord? ( sys-cluster/ipvsadm
+ dev-perl/Net-DNS
+ dev-perl/libwww-perl
+ dev-perl/perl-ldap
+ perl-core/libnet
+ dev-perl/Crypt-SSLeay
+ dev-perl/HTML-Parser
+ dev-perl/perl-ldap
+ dev-perl/Mail-IMAPClient
+ dev-perl/Mail-POP3Client
+ dev-perl/MailTools
+ )
+ snmp? ( net-analyzer/net-snmp )
+ net-misc/telnet-bsd
+ dev-lang/swig
+ management? (
+ >=dev-lang/python-2.4
+ >=dev-python/pygtk-2.4
+ >=sys-libs/pam-0.78-r3
+ )
+ "
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ epatch ${FILESDIR}/${P}-update-resources-failcount.patch || die
+}
+
+src_compile() {
+ append-ldflags $(bindnow-flags)
+
+ ./configure --prefix=/usr \
+ --mandir=/usr/share/man \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --with-group-name=cluster \
+ --with-group-id=65 \
+ --with-ccmuser-name=cluster \
+ --with-ccmuser-id=65 \
+ --enable-checkpointd \
+ --enable-crm \
+ --enable-lrm \
+ $(use_enable management mgmt) \
+ || die
+ emake -j 1 || die "compile problem"
+}
+
+pkg_preinst() {
+ # check for cluster group, if it doesn't exist make it
+ if ! grep -q cluster.*65 /etc/group ; then
+ groupadd -g 65 cluster
+ fi
+ # check for cluster user, if it doesn't exist make it
+ if ! grep -q cluster.*65 /etc/passwd ; then
+ useradd -u 65 -g cluster -s /dev/null -d /var/lib/heartbeat cluster
+ fi
+}
+
+src_install() {
+ make DESTDIR=${D} install || die
+
+ # heartbeat modules need these dirs
+ #keepdir /var/lib/heartbeat/ckpt /var/lib/heartbeat/ccm /var/lib/heartbeat
+
+ keepdir /var/lib/heartbeat/crm /var/lib/heartbeat/lrm /var/lib/heartbeat/fencing
+ keepdir /var/lib/heartbeat/cores/cluster /var/lib/heartbeat/cores/root /var/lib/heartbeat/cores/nobody
+
+ keepdir /var/run/heartbeat/ccm /var/run/heartbeat/crm
+
+ keepdir /etc/ha.d/conf
+
+ dosym /usr/sbin/ldirectord /etc/ha.d/resource.d/ldirectord || die
+
+ if use management ; then
+ keepdir /var/lib/heartbeat/mgmt
+ fi
+
+ # if ! USE="ldirectord" then don't install it
+ if ! use ldirectord ; then
+ rm ${D}/etc/init.d/ldirectord
+ rm ${D}/etc/logrotate.d/ldirectord
+ rm ${D}/etc/ha.d/resource.d/ldirectord
+ rm ${D}/usr/share/man/man8/supervise-ldirectord-config.8
+ rm ${D}/usr/share/man/man8/ldirectord.8
+ rm ${D}/usr/sbin/ldirectord
+ rm ${D}/usr/sbin/supervise-ldirectord-config
+ fi
+
+ exeinto /etc/init.d
+ newexe ${FILESDIR}/heartbeat-init heartbeat
+
+ dodoc ldirectord/ldirectord.cf doc/*.cf doc/haresources doc/authkeys || die
+ if use doc ; then
+ dodoc README doc/*.txt doc/AUTHORS doc/COPYING || die
+ fi
+}