diff --git a/.travis.yml b/.travis.yml index 820025f157a..9634df7d45d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ before_install: install: - sudo apt-get install -qq automake autoconf chrpath libglib2.0-dev perl net-tools python libtool libxml2-dev bison flex uuid-dev libbz2-dev zlib1g-dev libltdl3-dev libgnutls-dev python-central python-dev libpam0g-dev libncurses5-dev libcorosync-dev libxslt1-dev libdbus-1-dev - sudo apt-get install -qq cluster-glue-dev heartbeat-dev libheartbeat2-dev - - sudo apt-get install -qq libqb-dev/saucy + - sudo apt-get install -qq libqb-dev before_script: # Save and restore CC so that ./configure can pass diff --git a/GNUmakefile b/GNUmakefile index 2abba526842..fcc4e62fbd9 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -140,9 +140,13 @@ $(PACKAGE)-%.spec: $(PACKAGE).spec.in echo "Rebuilt $@ from $(TAG)"; \ fi +# rpmbuild apparently temporarily lost the ability to use --with arguments at some point +# Compensate by tweaking the format for pcmk_release here srpm-%: export $(PACKAGE)-%.spec rm -f *.src.rpm cp $(PACKAGE)-$*.spec $(PACKAGE).spec + echo "* $(shell date +"%a %b %d %Y") Andrew Beekhof $(shell git describe --tags $(TAG) | sed -e s:Pacemaker-:: -e s:-.*::)-1" >> $(PACKAGE).spec + echo " - See included ChangeLog file or https://raw.github.com/ClusterLabs/pacemaker/master/ChangeLog for full details" >> $(PACKAGE).spec if [ -e $(BUILD_COUNTER) ]; then \ echo $(COUNT) > $(BUILD_COUNTER); \ fi @@ -150,11 +154,12 @@ srpm-%: export $(PACKAGE)-%.spec sed -i 's/global\ commit.*/global\ commit\ $(TAG)/' $(PACKAGE).spec case "$(WITH)" in \ *pre_release*) \ - sed -i 's/Version:.*/Version:\ $(shell echo $(NEXT_RELEASE) | sed -e s:Pacemaker-:: -e s:-.*::)/' $(PACKAGE).spec;;\ + sed -i 's/global\ pcmk_release.*/global\ pcmk_release\ 0.%{specversion}.%{shortcommit}.git/' $(PACKAGE).spec; \ + sed -i 's/Version:.*/Version:\ $(shell echo $(NEXT_RELEASE) | sed -e s:Pacemaker-:: -e s:-.*::)/' $(PACKAGE).spec;; \ *) \ sed -i 's/Version:.*/Version:\ $(shell git describe --tags $(TAG) | sed -e s:Pacemaker-:: -e s:-.*::)/' $(PACKAGE).spec;;\ esac - rpmbuild -bs --define "dist .$*" $(RPM_OPTS) $(WITH) $(PACKAGE).spec + rpmbuild -bs --define "dist .$*" $(RPM_OPTS) $(PACKAGE).spec chroot: mock-$(MOCK_CFG) mock-install-$(MOCK_CFG) mock-sh-$(MOCK_CFG) echo "Done" diff --git a/Makefile.am b/Makefile.am index 8296a4bf833..f9d7bbbbb85 100644 --- a/Makefile.am +++ b/Makefile.am @@ -55,10 +55,8 @@ core-clean: install-exec-local: $(INSTALL) -d $(DESTDIR)/$(LCRSODIR) $(INSTALL) -d -m 750 $(DESTDIR)/$(CRM_CONFIG_DIR) - $(INSTALL) -d -m 750 $(DESTDIR)/$(CRM_STATE_DIR) $(INSTALL) -d -m 750 $(DESTDIR)/$(CRM_BLACKBOX_DIR) -chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/$(CRM_CONFIG_DIR) - -chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/$(CRM_STATE_DIR) -chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/$(CRM_BLACKBOX_DIR) if BUILD_CS_PLUGIN rm -f $(DESTDIR)$(LCRSODIR)/pacemaker.lcrso $(DESTDIR)$(LCRSODIR)/service_crm.so diff --git a/crmd/te_events.c b/crmd/te_events.c index 31b1c4ba399..62002534d10 100644 --- a/crmd/te_events.c +++ b/crmd/te_events.c @@ -589,10 +589,8 @@ process_graph_event(xmlNode * event, const char *event_node) abort_transition(INFINITY, tg_restart, "Unknown event", event); } else { - /* XML_ATTR_TE_ALLOWFAIL will be true if on-fail=ignore for the operation */ - ignore_failures = crm_is_true(crm_meta_value(action->params, - XML_ATTR_TE_ALLOWFAIL)); - + ignore_failures = safe_str_eq( + crm_meta_value(action->params, XML_OP_ATTR_ON_FAIL), "ignore"); match_graph_event(action, event, status, rc, target_rc, ignore_failures); } } diff --git a/include/crm/msg_xml.h b/include/crm/msg_xml.h index 1ac929fc534..8b8a3233277 100644 --- a/include/crm/msg_xml.h +++ b/include/crm/msg_xml.h @@ -342,7 +342,6 @@ # define XML_ATTR_TE_NOWAIT "op_no_wait" # define XML_ATTR_TE_TARGET_RC "op_target_rc" -# define XML_ATTR_TE_ALLOWFAIL "op_allow_fail" # define XML_ATTR_LRM_PROBE "lrm-is-probe" # define XML_TAG_TRANSIENT_NODEATTRS "transient_attributes" @@ -393,6 +392,9 @@ # define XML_DIFF_PATH "path" # define XML_DIFF_POSITION "position" +/* Defined for backward API compatibility but no longer used by Pacemaker */ +# define XML_ATTR_TE_ALLOWFAIL "op_allow_fail" + # include # define ID(x) crm_element_value(x, XML_ATTR_ID) diff --git a/include/crm/pengine/status.h b/include/crm/pengine/status.h index f7c8fac239d..957fea21518 100644 --- a/include/crm/pengine/status.h +++ b/include/crm/pengine/status.h @@ -218,7 +218,7 @@ enum pe_action_flags { pe_action_print_always = 0x00008, pe_action_have_node_attrs = 0x00010, - pe_action_failure_is_fatal = 0x00020, + pe_action_failure_is_fatal = 0x00020, /* no longer used, here for API compatibility */ pe_action_implied_by_stonith = 0x00040, pe_action_migrate_runnable = 0x00080, diff --git a/lib/pengine/utils.c b/lib/pengine/utils.c index 69824a1597c..f5789b6e20a 100644 --- a/lib/pengine/utils.c +++ b/lib/pengine/utils.c @@ -416,7 +416,6 @@ custom_action(resource_t * rsc, char *key, const char *task, } action->uuid = strdup(key); - pe_set_action_bit(action, pe_action_failure_is_fatal); pe_set_action_bit(action, pe_action_runnable); if (optional) { pe_rsc_trace(rsc, "Set optional on %s", action->uuid); @@ -770,7 +769,6 @@ unpack_operation(action_t * action, xmlNode * xml_obj, resource_t * container, } else if (safe_str_eq(value, "ignore") || safe_str_eq(value, "nothing")) { action->on_fail = action_fail_ignore; - pe_clear_action_bit(action, pe_action_failure_is_fatal); value = "ignore"; } else if (safe_str_eq(value, "migrate")) { diff --git a/pacemaker.spec.in b/pacemaker.spec.in index 971804e6d09..98cefa836dc 100644 --- a/pacemaker.spec.in +++ b/pacemaker.spec.in @@ -263,7 +263,7 @@ docdir=%{pcmk_docdir} %{configure} \ %{?with_profiling: --with-profiling} \ %{?with_coverage: --with-coverage} \ %{!?with_cman: --without-cman} \ - --without-heartbeat \ + --without-heartbeat \ --with-initdir=%{_initrddir} \ --localstatedir=%{_var} \ --with-version=%{version}-%{release} @@ -450,7 +450,6 @@ exit 0 %dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/cores %dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/pengine %dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/blackbox -%ghost %dir %attr (750, %{uname}, %{gname}) %{_var}/run/crm %dir /usr/lib/ocf %dir /usr/lib/ocf/resource.d /usr/lib/ocf/resource.d/pacemaker @@ -566,327 +565,11 @@ exit 0 %{_includedir}/pacemaker %{_libdir}/*.so %if %{with coverage} -%{_var}/lib/pacemaker +%{_var}/lib/pacemaker/gcov %endif %{_libdir}/pkgconfig/*.pc %doc COPYING.LIB %doc AUTHORS %changelog -* Fri Jul 26 2013 Andrew Beekhof 1.1.10-1 -- Update source tarball to revision: Pacemaker-1.1.10 -- Changesets: 602 -- Diff: 143 files changed, 8162 insertions(+), 5159 deletions(-) -- See included ChangeLog file or https://raw.github.com/ClusterLabs/pacemaker/master/ChangeLog for full details - -* Thu Jun 20 2013 Andrew Beekhof Pacemaker-1.1.9-2 -- Simplify the spec file -- Drop uncommon bcond variations: - with-heartbeat, without-cman, without-corosync, with-esmtp, with-snmp -- Drop bcond compatibility macros (everywhere has them now) -- Simplify python macros -- Use macroized systemd pre,post scriptlets -- Don't install SYSV init scripts if systemd is in use - -* Fri Mar 08 2013 Andrew Beekhof Pacemaker-1.1.9-1 -- Update source tarball to revision: 7e42d77 -- Statistics: - Changesets: 731 - Diff: 1301 files changed, 92909 insertions(+), 57455 deletions(-) -- See included ChangeLog file or https://github.com/ClusterLabs/pacemaker/blob/master/ChangeLog for details - -* Thu Sep 20 2012 Andrew Beekhof Pacemaker-1.1.8-1 -- Update source tarball to revision: 1a5341f -- Statistics: - Changesets: 1019 - Diff: 2107 files changed, 117258 insertions(+), 73606 deletions(-) -- See included ChangeLog file or https://github.com/ClusterLabs/pacemaker/blob/master/ChangeLog for details - - -* Wed Mar 28 2012 Andrew Beekhof Pacemaker-1.1.7-1 -- Update source tarball to revision: bc7ff2c -- Statistics: - Changesets: 513 - Diff: 1171 files changed, 90472 insertions(+), 19368 deletions(-) -- See included ChangeLog file or https://github.com/ClusterLabs/pacemaker/blob/master/ChangeLog for details - -* Wed Aug 31 2011 Andrew Beekhof 1.1.6-1 -- Update source tarball to revision: 676e5f25aa46 tip -- Statistics: - Changesets: 376 - Diff: 1761 files changed, 36259 insertions(+), 140578 deletions(-) -- See included ChangeLog file or https://github.com/ClusterLabs/pacemaker/blob/master/ChangeLog for details - -* Fri Feb 11 2011 Andrew Beekhof 1.1.5-1 -- Update source tarball to revision: baad6636a053 -- Statistics: - Changesets: 184 - Diff: 605 files changed, 46103 insertions(+), 26417 deletions(-) -- See included ChangeLog file or https://github.com/ClusterLabs/pacemaker/blob/master/ChangeLog for details - -* Wed Oct 20 2010 Andrew Beekhof 1.1.4-1 -- Moved all the interesting parts of the changelog into a separate file as per the Fedora policy :-/ -- Update source tarball to revision: 75406c3eb2c1 tip -- Significant performance enhancements to the Policy Engine and CIB -- Statistics: - Changesets: 169 - Diff: 772 files changed, 56172 insertions(+), 39309 deletions(-) -- See included ChangeLog file or http://hg.clusterlabs.org/pacemaker/1.1/file/tip/ChangeLog for details - -* Tue Sep 21 2010 Andrew Beekhof 1.1.3-1 -- Update source tarball to revision: e3bb31c56244 tip -- Statistics: - Changesets: 352 - Diff: 481 files changed, 14130 insertions(+), 11156 deletions(-) - -* Wed May 12 2010 Andrew Beekhof 1.1.2-1 -- Update source tarball to revision: c25c972a25cc tip -- Statistics: - Changesets: 339 - Diff: 708 files changed, 37918 insertions(+), 10584 deletions(-) - -* Tue Feb 16 2010 Andrew Beekhof - 1.1.1-1 -- First public release of Pacemaker 1.1 -- Package reference documentation in a doc subpackage -- Move cts into a subpackage so that it can be easily consumed by others -- Update source tarball to revision: 17d9cd4ee29f - + New stonith daemon that supports global notifications - + Service placement influenced by the physical resources - + A new tool for simulating failures and the cluster’s reaction to them - + Ability to serialize an otherwise unrelated a set of resource actions (eg. Xen migrations) - -* Wed Feb 10 2010 Andrew Beekhof - 1.0.7-4 -- Rebuild for heartbeat 3.0.2-2 - -* Wed Feb 10 2010 Andrew Beekhof - 1.0.7-3 -- Rebuild for cluster-glue 1.0.3 - -* Tue Jan 19 2010 Andrew Beekhof - 1.0.7-2 -- Rebuild for corosync 1.2.0 - -* Mon Jan 18 2010 Andrew Beekhof - 1.0.7-1 -- Update source tarball to revision: 2eed906f43e9 (stable-1.0) tip -- Statistics: - Changesets: 193 - Diff: 220 files changed, 15933 insertions(+), 8782 deletions(-) - -* Thu Oct 29 2009 Andrew Beekhof - 1.0.5-4 -- Include the fixes from CoroSync integration testing -- Move the resource templates - they are not documentation -- Ensure documentation is placed in a standard location -- Exclude documentation that is included elsewhere in the package - -- Update the tarball from upstream to version ee19d8e83c2a - + High: cib: Correctly clean up when both plaintext and tls remote ports are requested - + High: PE: Bug bnc#515172 - Provide better defaults for lt(e) and gt(e) comparisions - + High: PE: Bug lf#2197 - Allow master instances placemaker to be influenced by colocation constraints - + High: PE: Make sure promote/demote pseudo actions are created correctly - + High: PE: Prevent target-role from promoting more than master-max instances - + High: ais: Bug lf#2199 - Prevent expected-quorum-votes from being populated with garbage - + High: ais: Prevent deadlock - dont try to release IPC message if the connection failed - + High: cib: For validation errors, send back the full CIB so the client can display the errors - + High: cib: Prevent use-after-free for remote plaintext connections - + High: crmd: Bug lf#2201 - Prevent use-of-NULL when running heartbeat - -* Tue Oct 13 2009 Andrew Beekhof - 1.0.5-3 -- Update the tarball from upstream to version 38cd629e5c3c - + High: Core: Bug lf#2169 - Allow dtd/schema validation to be disabled - + High: PE: Bug lf#2106 - Not all anonymous clone children are restarted after configuration change - + High: PE: Bug lf#2170 - stop-all-resources option had no effect - + High: PE: Bug lf#2171 - Prevent groups from starting if they depend on a complex resource which can not - + High: PE: Disable resource management if stonith-enabled=true and no stonith resources are defined - + High: PE: do not include master score if it would prevent allocation - + High: ais: Avoid excessive load by checking for dead children every 1s (instead of 100ms) - + High: ais: Bug rh#525589 - Prevent shutdown deadlocks when running on CoroSync - + High: ais: Gracefully handle changes to the AIS nodeid - + High: crmd: Bug bnc#527530 - Wait for the transition to complete before leaving S_TRANSITION_ENGINE - + High: crmd: Prevent use-after-free with LOG_DEBUG_3 - + Medium: xml: Mask the "symmetrical" attribute on rsc_colocation constraints (bnc#540672) - + Medium (bnc#520707): Tools: crm: new templates ocfs2 and clvm - + Medium: Build: Invert the disable ais/heartbeat logic so that --without (ais|heartbeat) is available to rpmbuild - + Medium: PE: Bug lf#2178 - Indicate unmanaged clones - + Medium: PE: Bug lf#2180 - Include node information for all failed ops - + Medium: PE: Bug lf#2189 - Incorrect error message when unpacking simple ordering constraint - + Medium: PE: Correctly log resources that would like to start but can not - + Medium: PE: Stop ptest from logging to syslog - + Medium: ais: Include version details in plugin name - + Medium: crmd: Requery the resource metadata after every start operation - -* Fri Aug 21 2009 Tomas Mraz - 1.0.5-2.1 -- rebuilt with new openssl - -* Wed Aug 19 2009 Andrew Beekhof - 1.0.5-2 -- Add versioned perl dependency as specified by - https://fedoraproject.org/wiki/Packaging/Perl#Packages_that_link_to_libperl -- No longer remove RPATH data, it prevents us finding libperl.so and no other - libraries were being hardcoded -- Compile in support for heartbeat -- Conditionally add heartbeat-devel and corosynclib-devel to the -devel requirements - depending on which stacks are supported - -* Mon Aug 17 2009 Andrew Beekhof - 1.0.5-1 -- Add dependency on resource-agents -- Use the version of the configure macro that supplies --prefix, --libdir, etc -- Update the tarball from upstream to version 462f1569a437 (Pacemaker 1.0.5 final) - + High: Tools: crm_resource - Advertise --move instead of --migrate - + Medium: Extra: New node connectivity RA that uses system ping and attrd_updater - + Medium: crmd: Note that dc-deadtime can be used to mask the brokeness of some switches - -* Tue Aug 11 2009 Ville Skyttä - 1.0.5-0.7.c9120a53a6ae.hg -- Use bzipped upstream tarball. - -* Wed Jul 29 2009 Andrew Beekhof - 1.0.5-0.6.c9120a53a6ae.hg -- Add back missing build auto* dependancies -- Minor cleanups to the install directive - -* Tue Jul 28 2009 Andrew Beekhof - 1.0.5-0.5.c9120a53a6ae.hg -- Add a leading zero to the revision when alphatag is used - -* Tue Jul 28 2009 Andrew Beekhof - 1.0.5-0.4.c9120a53a6ae.hg -- Incorporate the feedback from the cluster-glue review -- Realistically, the version is a 1.0.5 pre-release -- Use the global directive instead of define for variables -- Use the haclient/hacluster group/user instead of daemon -- Use the _configure macro -- Fix install dependancies - -* Fri Jul 24 2009 Andrew Beekhof - 1.0.4-3 -- Initial Fedora checkin -- Include an AUTHORS and license file in each package -- Change the library package name to pacemaker-libs to be more - Fedora compliant -- Remove execute permissions from xml related files -- Reference the new cluster-glue devel package name -- Update the tarball from upstream to version c9120a53a6ae - + High: PE: Only prevent migration if the clone dependency is stopping/starting on the target node - + High: PE: Bug 2160 - Dont shuffle clones due to colocation - + High: PE: New implementation of the resource migration (not stop/start) logic - + Medium: Tools: crm_resource - Prevent use-of-NULL by requiring a resource name for the -A and -a options - + Medium: PE: Prevent use-of-NULL in find_first_action() - -* Tue Jul 14 2009 Andrew Beekhof - 1.0.4-2 -- Reference authors from the project AUTHORS file instead of listing in description -- Change Source0 to reference the Mercurial repo -- Cleaned up the summaries and descriptions -- Incorporate the results of Fedora package self-review - -* Thu Jun 04 2009 Andrew Beekhof - 1.0.4-1 -- Update source tarball to revision: 1d87d3e0fc7f (stable-1.0) -- Statistics: - Changesets: 209 - Diff: 266 files changed, 12010 insertions(+), 8276 deletions(-) - -* Wed Apr 08 2009 Andrew Beekhof - 1.0.3-1 -- Update source tarball to revision: b133b3f19797 (stable-1.0) tip -- Statistics: - Changesets: 383 - Diff: 329 files changed, 15471 insertions(+), 15119 deletions(-) - -* Mon Feb 16 2009 Andrew Beekhof - 1.0.2-1 -- Update source tarball to revision: d232d19daeb9 (stable-1.0) tip -- Statistics: - Changesets: 441 - Diff: 639 files changed, 20871 insertions(+), 21594 deletions(-) - -* Tue Nov 18 2008 Andrew Beekhof - 1.0.1-1 -- Update source tarball to revision: 6fc5ce8302ab (stable-1.0) tip -- Statistics: - Changesets: 170 - Diff: 816 files changed, 7633 insertions(+), 6286 deletions(-) - -* Thu Oct 16 2008 Andrew Beekhof - 1.0.0-1 -- Update source tarball to revision: 388654dfef8f tip -- Statistics: - Changesets: 261 - Diff: 3021 files changed, 244985 insertions(+), 111596 deletions(-) - -* Mon Sep 22 2008 Andrew Beekhof - 0.7.3-1 -- Update source tarball to revision: 33e677ab7764+ tip -- Statistics: - Changesets: 133 - Diff: 89 files changed, 7492 insertions(+), 1125 deletions(-) - -* Wed Aug 20 2008 Andrew Beekhof - 0.7.1-1 -- Update source tarball to revision: f805e1b30103+ tip -- Statistics: - Changesets: 184 - Diff: 513 files changed, 43408 insertions(+), 43783 deletions(-) - -* Fri Jul 18 2008 Andrew Beekhof - 0.7.0-19 -- Update source tarball to revision: 007c3a1c50f5 (unstable) tip -- Statistics: - Changesets: 108 - Diff: 216 files changed, 4632 insertions(+), 4173 deletions(-) - -* Wed Jun 25 2008 Andrew Beekhof - 0.7.0-1 -- Update source tarball to revision: bde0c7db74fb tip -- Statistics: - Changesets: 439 - Diff: 676 files changed, 41310 insertions(+), 52071 deletions(-) - -* Thu Jun 19 2008 Andrew Beekhof - 0.6.5-1 -- Update source tarball to revision: b9fe723d1ac5 tip -- Statistics: - Changesets: 48 - Diff: 37 files changed, 1204 insertions(+), 234 deletions(-) - -* Thu May 22 2008 Andrew Beekhof - 0.6.4-1 -- Update source tarball to revision: 226d8e356924 tip -- Statistics: - Changesets: 55 - Diff: 199 files changed, 7103 insertions(+), 12378 deletions(-) - -* Wed Apr 23 2008 Andrew Beekhof - 0.6.3-1 -- Update source tarball to revision: fd8904c9bc67 tip -- Statistics: - Changesets: 117 - Diff: 354 files changed, 19094 insertions(+), 11338 deletions(-) - -* Thu Feb 14 2008 Andrew Beekhof - 0.6.2-1 -- Update source tarball to revision: 28b1a8c1868b tip -- Statistics: - Changesets: 11 - Diff: 7 files changed, 58 insertions(+), 18 deletions(-) - -* Tue Feb 12 2008 Andrew Beekhof - 0.6.1-1 -- Update source tarball to revision: e7152d1be933 tip -- Statistics: - Changesets: 25 - Diff: 37 files changed, 1323 insertions(+), 227 deletions(-) - -* Mon Jan 14 2008 Andrew Beekhof - 0.6.0-2 -- This is the first release of the Pacemaker Cluster Resource Manager formerly part of Heartbeat. -- For those looking for the GUI, mgmtd, CIM or TSA components, they are now found in - the new pacemaker-pygui project. Build dependancies prevent them from being - included in Heartbeat (since the built-in CRM is no longer supported) and, - being non-core components, are not included with Pacemaker. -- Update source tarball to revision: c94b92d550cf -- Statistics: - Changesets: 347 - Diff: 2272 files changed, 132508 insertions(+), 305991 deletions(-) -- Test hardware: - + 6-node vmware cluster (sles10-sp1/256Mb/vmware stonith) on a single host (opensuse10.3/2Gb/2.66Ghz Quad Core2) - + 7-node EMC Centera cluster (sles10/512Mb/2Ghz Xeon/ssh stonith) -- Notes: Heartbeat Stack - + All testing was performed with STONITH enabled - + The CRM was enabled using the "crm respawn" directive -- Notes: OpenAIS Stack - + This release contains a preview of support for the OpenAIS cluster stack - + The current release of the OpenAIS project is missing two important - patches that we require. OpenAIS packages containing these patches are - available for most major distributions at: - http://download.opensuse.org/repositories/server:/ha-clustering - + The OpenAIS stack is not currently recommended for use in clusters that - have shared data as STONITH support is not yet implimented - + pingd is not yet available for use with the OpenAIS stack - + 3 significant OpenAIS issues were found during testing of 4 and 6 node - clusters. We are activly working together with the OpenAIS project to - get these resolved. -- Pending bugs encountered during testing: - + OpenAIS #1736 - Openais membership took 20s to stabilize - + Heartbeat #1750 - ipc_bufpool_update: magic number in head does not match - + OpenAIS #1793 - Assertion failure in memb_state_gather_enter() - + OpenAIS #1796 - Cluster message corruption - -* Mon Dec 10 2007 Andrew Beekhof - 0.6.0-1 -- Initial opensuse package check-in + diff --git a/pengine/Makefile.am b/pengine/Makefile.am index 4b2c69cd2ba..d14d911e32d 100644 --- a/pengine/Makefile.am +++ b/pengine/Makefile.am @@ -64,7 +64,7 @@ noinst_HEADERS = allocate.h utils.h pengine.h libpengine_la_LDFLAGS = -version-info 8:0:0 # -L$(top_builddir)/lib/pils -lpils -export-dynamic -module -avoid-version libpengine_la_SOURCES = pengine.c allocate.c utils.c constraints.c -libpengine_la_SOURCES += native.c group.c clone.c master.c graph.c +libpengine_la_SOURCES += native.c group.c clone.c master.c graph.c utilization.c libpengine_la_LIBADD = $(top_builddir)/lib/pengine/libpe_status.la \ $(top_builddir)/lib/cib/libcib.la diff --git a/pengine/allocate.c b/pengine/allocate.c index a882d6c4bfc..230674701ac 100644 --- a/pengine/allocate.c +++ b/pengine/allocate.c @@ -1058,7 +1058,8 @@ sort_rsc_process_order(gconstpointer a, gconstpointer b, gpointer data) resource_t *resource1 = (resource_t *) convert_const_pointer(a); resource_t *resource2 = (resource_t *) convert_const_pointer(b); - node_t *node = NULL; + node_t *r1_node = NULL; + node_t *r2_node = NULL; GListPtr gIter = NULL; GHashTable *r1_nodes = NULL; GHashTable *r2_nodes = NULL; @@ -1107,17 +1108,17 @@ sort_rsc_process_order(gconstpointer a, gconstpointer b, gpointer data) r2_weight = -INFINITY; if (resource1->running_on) { - node = g_list_nth_data(resource1->running_on, 0); - node = g_hash_table_lookup(r1_nodes, node->details->id); - if (node != NULL) { - r1_weight = node->weight; + r1_node = g_list_nth_data(resource1->running_on, 0); + r1_node = g_hash_table_lookup(r1_nodes, r1_node->details->id); + if (r1_node != NULL) { + r1_weight = r1_node->weight; } } if (resource2->running_on) { - node = g_list_nth_data(resource2->running_on, 0); - node = g_hash_table_lookup(r2_nodes, node->details->id); - if (node != NULL) { - r2_weight = node->weight; + r2_node = g_list_nth_data(resource2->running_on, 0); + r2_node = g_hash_table_lookup(r2_nodes, r2_node->details->id); + if (r2_node != NULL) { + r2_weight = r2_node->weight; } } @@ -1133,10 +1134,10 @@ sort_rsc_process_order(gconstpointer a, gconstpointer b, gpointer data) reason = "score"; for (gIter = nodes; gIter != NULL; gIter = gIter->next) { - node_t *r1_node = NULL; - node_t *r2_node = NULL; + node_t *node = (node_t *) gIter->data; - node = (node_t *) gIter->data; + r1_node = NULL; + r2_node = NULL; r1_weight = -INFINITY; if (r1_nodes) { @@ -1166,6 +1167,11 @@ sort_rsc_process_order(gconstpointer a, gconstpointer b, gpointer data) } done: + crm_trace("%s (%d) on %s %c %s (%d) on %s: %s", + resource1->id, r1_weight, r1_node ? r1_node->details->id : "n/a", + rc < 0 ? '>' : rc > 0 ? '<' : '=', + resource2->id, r2_weight, r2_node ? r2_node->details->id : "n/a", reason); + if (r1_nodes) { g_hash_table_destroy(r1_nodes); } @@ -1173,9 +1179,6 @@ sort_rsc_process_order(gconstpointer a, gconstpointer b, gpointer data) g_hash_table_destroy(r2_nodes); } - crm_trace("%s (%d) %c %s (%d) on %s: %s", - resource1->id, r1_weight, rc < 0 ? '>' : rc > 0 ? '<' : '=', - resource2->id, r2_weight, node ? node->details->id : "n/a", reason); return rc; } diff --git a/pengine/graph.c b/pengine/graph.c index 3b9b80a1817..068859048fb 100644 --- a/pengine/graph.c +++ b/pengine/graph.c @@ -823,10 +823,6 @@ action2xml(action_t * action, gboolean as_input, pe_working_set_t *data_set) } } - if (is_set(action->flags, pe_action_failure_is_fatal) == FALSE) { - add_hash_param(action->meta, XML_ATTR_TE_ALLOWFAIL, XML_BOOLEAN_TRUE); - } - if (as_input) { return action_xml; } diff --git a/pengine/native.c b/pengine/native.c index ef2387c12d6..0a97aaa03e4 100644 --- a/pengine/native.c +++ b/pengine/native.c @@ -79,49 +79,8 @@ gboolean (*rsc_action_matrix[RSC_ROLE_MAX][RSC_ROLE_MAX])(resource_t*,node_t*,gb }; /* *INDENT-ON* */ -struct capacity_data { - node_t *node; - resource_t *rsc; - gboolean is_enough; -}; - static action_t * get_first_named_action(resource_t * rsc, const char *action, gboolean only_valid, node_t * current); -static void -check_capacity(gpointer key, gpointer value, gpointer user_data) -{ - int required = 0; - int remaining = 0; - struct capacity_data *data = user_data; - - required = crm_parse_int(value, "0"); - remaining = crm_parse_int(g_hash_table_lookup(data->node->details->utilization, key), "0"); - - if (required > remaining) { - CRM_ASSERT(data->rsc); - CRM_ASSERT(data->node); - - pe_rsc_debug(data->rsc, - "Node %s has no enough %s for resource %s: required=%d remaining=%d", - data->node->details->uname, (char *)key, data->rsc->id, required, remaining); - data->is_enough = FALSE; - } -} - -static gboolean -have_enough_capacity(node_t * node, resource_t * rsc) -{ - struct capacity_data data; - - data.node = node; - data.rsc = rsc; - data.is_enough = TRUE; - - g_hash_table_foreach(rsc->utilization, check_capacity, &data); - - return data.is_enough; -} - static gboolean native_choose_node(resource_t * rsc, node_t * prefer, pe_working_set_t * data_set) { @@ -131,8 +90,6 @@ native_choose_node(resource_t * rsc, node_t * prefer, pe_working_set_t * data_se with the fewest resources 3. remove color.chosen_node from all other colors */ - int alloc_details = scores_log_level + 1; - GListPtr nodes = NULL; node_t *chosen = NULL; @@ -141,21 +98,7 @@ native_choose_node(resource_t * rsc, node_t * prefer, pe_working_set_t * data_se int length = 0; gboolean result = FALSE; - if (safe_str_neq(data_set->placement_strategy, "default")) { - GListPtr gIter = NULL; - - for (gIter = data_set->nodes; gIter != NULL; gIter = gIter->next) { - node_t *node = (node_t *) gIter->data; - - if (have_enough_capacity(node, rsc) == FALSE) { - pe_rsc_debug(rsc, - "Resource %s cannot be allocated to node %s: none of enough capacity", - rsc->id, node->details->uname); - resource_location(rsc, node, -INFINITY, "__limit_utilization_", data_set); - } - } - dump_node_scores(alloc_details, rsc, "Post-utilization", rsc->allowed_nodes); - } + process_utilization(rsc, &prefer, data_set); length = g_hash_table_size(rsc->allowed_nodes); @@ -1558,22 +1501,16 @@ native_rsc_colocation_lh(resource_t * rsc_lh, resource_t * rsc_rh, rsc_colocatio rsc_rh->cmds->rsc_colocation_rh(rsc_lh, rsc_rh, constraint); } -enum filter_colocation_res { - influence_nothing = 0, - influence_rsc_location, - influence_rsc_priority, -}; - -static enum filter_colocation_res +enum filter_colocation_res filter_colocation_constraint(resource_t * rsc_lh, resource_t * rsc_rh, - rsc_colocation_t * constraint) + rsc_colocation_t * constraint, gboolean preview) { if (constraint->score == 0) { return influence_nothing; } /* rh side must be allocated before we can process constraint */ - if (is_set(rsc_rh->flags, pe_rsc_provisional)) { + if (preview == FALSE && is_set(rsc_rh->flags, pe_rsc_provisional)) { return influence_nothing; } @@ -1586,7 +1523,7 @@ filter_colocation_constraint(resource_t * rsc_lh, resource_t * rsc_rh, return influence_rsc_priority; } - if (is_not_set(rsc_lh->flags, pe_rsc_provisional)) { + if (preview == FALSE && is_not_set(rsc_lh->flags, pe_rsc_provisional)) { /* error check */ struct node_shared_s *details_lh; struct node_shared_s *details_rh; @@ -1755,7 +1692,7 @@ native_rsc_colocation_rh(resource_t * rsc_lh, resource_t * rsc_rh, rsc_colocatio CRM_ASSERT(rsc_lh); CRM_ASSERT(rsc_rh); - filter_results = filter_colocation_constraint(rsc_lh, rsc_rh, constraint); + filter_results = filter_colocation_constraint(rsc_lh, rsc_rh, constraint, FALSE); pe_rsc_trace(rsc_lh, "%sColocating %s with %s (%s, weight=%d, filter=%d)", constraint->score >= 0 ? "" : "Anti-", rsc_lh->id, rsc_rh->id, constraint->id, constraint->score, filter_results); diff --git a/pengine/regression.sh b/pengine/regression.sh index 52971cdce3e..a88a08435fd 100755 --- a/pengine/regression.sh +++ b/pengine/regression.sh @@ -558,6 +558,12 @@ do_test utilization-order4 "Utilization Order - Live Mirgration (bnc#695440)" do_test utilization-shuffle "Don't displace prmExPostgreSQLDB2 on act2, Start prmExPostgreSQLDB1 on act3" do_test load-stopped-loop "Avoid transition loop due to load_stopped (cl#5044)" +echo "" +do_test colocated-utilization-primitive-1 "Colocated Utilization - Primitive" +do_test colocated-utilization-primitive-2 "Colocated Utilization - Choose the most capable node" +do_test colocated-utilization-group "Colocated Utilization - Group" +do_test colocated-utilization-clone "Colocated Utilization - Clone" + echo "" do_test reprobe-target_rc "Ensure correct target_rc for reprobe of inactive resources" do_test node-maintenance-1 "cl#5128 - Node maintenance" diff --git a/pengine/test10/colocated-utilization-clone.dot b/pengine/test10/colocated-utilization-clone.dot new file mode 100644 index 00000000000..3a84fa0af14 --- /dev/null +++ b/pengine/test10/colocated-utilization-clone.dot @@ -0,0 +1,106 @@ +digraph "g" { +"clone1_running_0" -> "clone2_start_0" [ style = bold] +"clone1_running_0" [ style=bold color="green" fontcolor="orange"] +"clone1_start_0" -> "clone1_running_0" [ style = bold] +"clone1_start_0" -> "rsc1:0_start_0 node2" [ style = bold] +"clone1_start_0" -> "rsc1:1_start_0 node3" [ style = bold] +"clone1_start_0" [ style=bold color="green" fontcolor="orange"] +"clone2_running_0" -> "group2_start_0" [ style = bold] +"clone2_running_0" [ style=bold color="green" fontcolor="orange"] +"clone2_start_0" -> "clone2_running_0" [ style = bold] +"clone2_start_0" -> "group1:0_start_0" [ style = bold] +"clone2_start_0" -> "group1:1_start_0" [ style = bold] +"clone2_start_0" [ style=bold color="green" fontcolor="orange"] +"group1:0_running_0" -> "clone2_running_0" [ style = bold] +"group1:0_running_0" [ style=bold color="green" fontcolor="orange"] +"group1:0_start_0" -> "group1:0_running_0" [ style = bold] +"group1:0_start_0" -> "rsc2:0_start_0 node3" [ style = bold] +"group1:0_start_0" -> "rsc3:0_start_0 node3" [ style = bold] +"group1:0_start_0" [ style=bold color="green" fontcolor="orange"] +"group1:1_running_0" -> "clone2_running_0" [ style = bold] +"group1:1_running_0" [ style=bold color="green" fontcolor="orange"] +"group1:1_start_0" -> "group1:1_running_0" [ style = bold] +"group1:1_start_0" -> "rsc2:1_start_0 node2" [ style = bold] +"group1:1_start_0" -> "rsc3:1_start_0 node2" [ style = bold] +"group1:1_start_0" [ style=bold color="green" fontcolor="orange"] +"group2_running_0" [ style=bold color="green" fontcolor="orange"] +"group2_start_0" -> "group2_running_0" [ style = bold] +"group2_start_0" -> "rsc4_start_0 node3" [ style = bold] +"group2_start_0" -> "rsc5_start_0 node3" [ style = bold] +"group2_start_0" [ style=bold color="green" fontcolor="orange"] +"load_stopped_node1 node1" [ style=bold color="green" fontcolor="orange"] +"load_stopped_node2 node2" -> "rsc1:0_start_0 node2" [ style = bold] +"load_stopped_node2 node2" -> "rsc2:1_start_0 node2" [ style = bold] +"load_stopped_node2 node2" -> "rsc3:1_start_0 node2" [ style = bold] +"load_stopped_node2 node2" [ style=bold color="green" fontcolor="orange"] +"load_stopped_node3 node3" -> "rsc1:1_start_0 node3" [ style = bold] +"load_stopped_node3 node3" -> "rsc2:0_start_0 node3" [ style = bold] +"load_stopped_node3 node3" -> "rsc3:0_start_0 node3" [ style = bold] +"load_stopped_node3 node3" -> "rsc4_start_0 node3" [ style = bold] +"load_stopped_node3 node3" -> "rsc5_start_0 node3" [ style = bold] +"load_stopped_node3 node3" [ style=bold color="green" fontcolor="orange"] +"probe_complete node1" -> "probe_complete" [ style = bold] +"probe_complete node1" [ style=bold color="green" fontcolor="black"] +"probe_complete node2" -> "probe_complete" [ style = bold] +"probe_complete node2" [ style=bold color="green" fontcolor="black"] +"probe_complete node3" -> "probe_complete" [ style = bold] +"probe_complete node3" [ style=bold color="green" fontcolor="black"] +"probe_complete" -> "rsc1:0_start_0 node2" [ style = bold] +"probe_complete" -> "rsc1:1_start_0 node3" [ style = bold] +"probe_complete" -> "rsc2:0_start_0 node3" [ style = bold] +"probe_complete" -> "rsc2:1_start_0 node2" [ style = bold] +"probe_complete" -> "rsc3:0_start_0 node3" [ style = bold] +"probe_complete" -> "rsc3:1_start_0 node2" [ style = bold] +"probe_complete" -> "rsc4_start_0 node3" [ style = bold] +"probe_complete" -> "rsc5_start_0 node3" [ style = bold] +"probe_complete" [ style=bold color="green" fontcolor="orange"] +"rsc1:0_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc1:0_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc1:0_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc1:0_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc1:0_start_0 node2" -> "clone1_running_0" [ style = bold] +"rsc1:0_start_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc1:1_monitor_0 node3" -> "probe_complete node3" [ style = bold] +"rsc1:1_monitor_0 node3" [ style=bold color="green" fontcolor="black"] +"rsc1:1_start_0 node3" -> "clone1_running_0" [ style = bold] +"rsc1:1_start_0 node3" [ style=bold color="green" fontcolor="black"] +"rsc2:0_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc2:0_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc2:0_monitor_0 node3" -> "probe_complete node3" [ style = bold] +"rsc2:0_monitor_0 node3" [ style=bold color="green" fontcolor="black"] +"rsc2:0_start_0 node3" -> "group1:0_running_0" [ style = bold] +"rsc2:0_start_0 node3" -> "rsc3:0_start_0 node3" [ style = bold] +"rsc2:0_start_0 node3" [ style=bold color="green" fontcolor="black"] +"rsc2:1_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc2:1_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc2:1_start_0 node2" -> "group1:1_running_0" [ style = bold] +"rsc2:1_start_0 node2" -> "rsc3:1_start_0 node2" [ style = bold] +"rsc2:1_start_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc3:0_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc3:0_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc3:0_monitor_0 node3" -> "probe_complete node3" [ style = bold] +"rsc3:0_monitor_0 node3" [ style=bold color="green" fontcolor="black"] +"rsc3:0_start_0 node3" -> "group1:0_running_0" [ style = bold] +"rsc3:0_start_0 node3" [ style=bold color="green" fontcolor="black"] +"rsc3:1_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc3:1_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc3:1_start_0 node2" -> "group1:1_running_0" [ style = bold] +"rsc3:1_start_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc4_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc4_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc4_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc4_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc4_monitor_0 node3" -> "probe_complete node3" [ style = bold] +"rsc4_monitor_0 node3" [ style=bold color="green" fontcolor="black"] +"rsc4_start_0 node3" -> "group2_running_0" [ style = bold] +"rsc4_start_0 node3" -> "rsc5_start_0 node3" [ style = bold] +"rsc4_start_0 node3" [ style=bold color="green" fontcolor="black"] +"rsc5_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc5_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc5_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc5_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc5_monitor_0 node3" -> "probe_complete node3" [ style = bold] +"rsc5_monitor_0 node3" [ style=bold color="green" fontcolor="black"] +"rsc5_start_0 node3" -> "group2_running_0" [ style = bold] +"rsc5_start_0 node3" [ style=bold color="green" fontcolor="black"] +} diff --git a/pengine/test10/colocated-utilization-clone.exp b/pengine/test10/colocated-utilization-clone.exp new file mode 100644 index 00000000000..f1cb2f20650 --- /dev/null +++ b/pengine/test10/colocated-utilization-clone.exp @@ -0,0 +1,558 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/test10/colocated-utilization-clone.scores b/pengine/test10/colocated-utilization-clone.scores new file mode 100644 index 00000000000..36139a849d9 --- /dev/null +++ b/pengine/test10/colocated-utilization-clone.scores @@ -0,0 +1,82 @@ +Allocation scores: +clone_color: clone1 allocation score on node1: 0 +clone_color: clone1 allocation score on node2: 0 +clone_color: clone1 allocation score on node3: 0 +clone_color: clone2 allocation score on node1: 0 +clone_color: clone2 allocation score on node2: 0 +clone_color: clone2 allocation score on node3: 0 +clone_color: group1:0 allocation score on node1: 0 +clone_color: group1:0 allocation score on node2: 0 +clone_color: group1:0 allocation score on node3: 0 +clone_color: group1:1 allocation score on node1: 0 +clone_color: group1:1 allocation score on node2: 0 +clone_color: group1:1 allocation score on node3: 0 +clone_color: rsc1:0 allocation score on node1: 0 +clone_color: rsc1:0 allocation score on node2: 0 +clone_color: rsc1:0 allocation score on node3: 0 +clone_color: rsc1:1 allocation score on node1: 0 +clone_color: rsc1:1 allocation score on node2: 0 +clone_color: rsc1:1 allocation score on node3: 0 +clone_color: rsc2:0 allocation score on node1: 0 +clone_color: rsc2:0 allocation score on node2: 0 +clone_color: rsc2:0 allocation score on node3: 0 +clone_color: rsc2:1 allocation score on node1: 0 +clone_color: rsc2:1 allocation score on node2: 0 +clone_color: rsc2:1 allocation score on node3: 0 +clone_color: rsc3:0 allocation score on node1: 0 +clone_color: rsc3:0 allocation score on node2: 0 +clone_color: rsc3:0 allocation score on node3: 0 +clone_color: rsc3:1 allocation score on node1: 0 +clone_color: rsc3:1 allocation score on node2: 0 +clone_color: rsc3:1 allocation score on node3: 0 +group_color: group1:0 allocation score on node1: 0 +group_color: group1:0 allocation score on node2: 0 +group_color: group1:0 allocation score on node3: 0 +group_color: group1:1 allocation score on node1: 0 +group_color: group1:1 allocation score on node2: 0 +group_color: group1:1 allocation score on node3: -INFINITY +group_color: group2 allocation score on node1: 0 +group_color: group2 allocation score on node2: 0 +group_color: group2 allocation score on node3: 0 +group_color: rsc2:0 allocation score on node1: 0 +group_color: rsc2:0 allocation score on node2: 0 +group_color: rsc2:0 allocation score on node3: 0 +group_color: rsc2:1 allocation score on node1: 0 +group_color: rsc2:1 allocation score on node2: 0 +group_color: rsc2:1 allocation score on node3: -INFINITY +group_color: rsc3:0 allocation score on node1: 0 +group_color: rsc3:0 allocation score on node2: 0 +group_color: rsc3:0 allocation score on node3: 0 +group_color: rsc3:1 allocation score on node1: 0 +group_color: rsc3:1 allocation score on node2: 0 +group_color: rsc3:1 allocation score on node3: -INFINITY +group_color: rsc4 allocation score on node1: 0 +group_color: rsc4 allocation score on node2: 0 +group_color: rsc4 allocation score on node3: 0 +group_color: rsc5 allocation score on node1: 0 +group_color: rsc5 allocation score on node2: 0 +group_color: rsc5 allocation score on node3: 0 +native_color: rsc1:0 allocation score on node1: 0 +native_color: rsc1:0 allocation score on node2: 0 +native_color: rsc1:0 allocation score on node3: 0 +native_color: rsc1:1 allocation score on node1: 0 +native_color: rsc1:1 allocation score on node2: -INFINITY +native_color: rsc1:1 allocation score on node3: 0 +native_color: rsc2:0 allocation score on node1: -INFINITY +native_color: rsc2:0 allocation score on node2: 0 +native_color: rsc2:0 allocation score on node3: 0 +native_color: rsc2:1 allocation score on node1: -INFINITY +native_color: rsc2:1 allocation score on node2: 0 +native_color: rsc2:1 allocation score on node3: -INFINITY +native_color: rsc3:0 allocation score on node1: -INFINITY +native_color: rsc3:0 allocation score on node2: -INFINITY +native_color: rsc3:0 allocation score on node3: 0 +native_color: rsc3:1 allocation score on node1: -INFINITY +native_color: rsc3:1 allocation score on node2: 0 +native_color: rsc3:1 allocation score on node3: -INFINITY +native_color: rsc4 allocation score on node1: -INFINITY +native_color: rsc4 allocation score on node2: 0 +native_color: rsc4 allocation score on node3: 0 +native_color: rsc5 allocation score on node1: -INFINITY +native_color: rsc5 allocation score on node2: -INFINITY +native_color: rsc5 allocation score on node3: 0 diff --git a/pengine/test10/colocated-utilization-clone.summary b/pengine/test10/colocated-utilization-clone.summary new file mode 100644 index 00000000000..8c6b0eba0d0 --- /dev/null +++ b/pengine/test10/colocated-utilization-clone.summary @@ -0,0 +1,72 @@ + +Current cluster status: +Online: [ node1 node2 node3 ] + + Clone Set: clone1 [rsc1] + Stopped: [ node1 node2 node3 ] + Clone Set: clone2 [group1] + Stopped: [ node1 node2 node3 ] + Resource Group: group2 + rsc4 (ocf::pacemaker:Dummy): Stopped + rsc5 (ocf::pacemaker:Dummy): Stopped + +Transition Summary: + * Start rsc1:0 (node2) + * Start rsc1:1 (node3) + * Start rsc2:0 (node3) + * Start rsc3:0 (node3) + * Start rsc2:1 (node2) + * Start rsc3:1 (node2) + * Start rsc4 (node3) + * Start rsc5 (node3) + +Executing cluster transition: + * Resource action: rsc1:0 monitor on node2 + * Resource action: rsc1:0 monitor on node1 + * Resource action: rsc1:1 monitor on node3 + * Pseudo action: clone1_start_0 + * Resource action: rsc2:0 monitor on node3 + * Resource action: rsc2:0 monitor on node1 + * Resource action: rsc3:0 monitor on node3 + * Resource action: rsc3:0 monitor on node1 + * Resource action: rsc2:1 monitor on node2 + * Resource action: rsc3:1 monitor on node2 + * Resource action: rsc4 monitor on node3 + * Resource action: rsc4 monitor on node2 + * Resource action: rsc4 monitor on node1 + * Resource action: rsc5 monitor on node3 + * Resource action: rsc5 monitor on node2 + * Resource action: rsc5 monitor on node1 + * Pseudo action: probe_complete + * Pseudo action: load_stopped_node1 + * Pseudo action: load_stopped_node3 + * Pseudo action: load_stopped_node2 + * Resource action: rsc1:0 start on node2 + * Resource action: rsc1:1 start on node3 + * Pseudo action: clone1_running_0 + * Pseudo action: clone2_start_0 + * Pseudo action: group1:0_start_0 + * Resource action: rsc2:0 start on node3 + * Resource action: rsc3:0 start on node3 + * Pseudo action: group1:1_start_0 + * Resource action: rsc2:1 start on node2 + * Resource action: rsc3:1 start on node2 + * Pseudo action: group1:0_running_0 + * Pseudo action: group1:1_running_0 + * Pseudo action: clone2_running_0 + * Pseudo action: group2_start_0 + * Resource action: rsc4 start on node3 + * Resource action: rsc5 start on node3 + * Pseudo action: group2_running_0 + +Revised cluster status: +Online: [ node1 node2 node3 ] + + Clone Set: clone1 [rsc1] + Started: [ node2 node3 ] + Clone Set: clone2 [group1] + Started: [ node2 node3 ] + Resource Group: group2 + rsc4 (ocf::pacemaker:Dummy): Started node3 + rsc5 (ocf::pacemaker:Dummy): Started node3 + diff --git a/pengine/test10/colocated-utilization-clone.xml b/pengine/test10/colocated-utilization-clone.xml new file mode 100644 index 00000000000..fc3d55aba7c --- /dev/null +++ b/pengine/test10/colocated-utilization-clone.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/test10/colocated-utilization-group.dot b/pengine/test10/colocated-utilization-group.dot new file mode 100644 index 00000000000..dc5bd896bbb --- /dev/null +++ b/pengine/test10/colocated-utilization-group.dot @@ -0,0 +1,60 @@ +digraph "g" { +"group1_running_0" [ style=bold color="green" fontcolor="orange"] +"group1_start_0" -> "group1_running_0" [ style = bold] +"group1_start_0" -> "rsc2_start_0 node2" [ style = bold] +"group1_start_0" -> "rsc3_start_0 node2" [ style = bold] +"group1_start_0" [ style=bold color="green" fontcolor="orange"] +"group2_running_0" [ style=bold color="green" fontcolor="orange"] +"group2_start_0" -> "group2_running_0" [ style = bold] +"group2_start_0" -> "rsc4_start_0 node2" [ style = bold] +"group2_start_0" -> "rsc5_start_0 node2" [ style = bold] +"group2_start_0" [ style=bold color="green" fontcolor="orange"] +"load_stopped_node1 node1" [ style=bold color="green" fontcolor="orange"] +"load_stopped_node2 node2" -> "rsc1_start_0 node2" [ style = bold] +"load_stopped_node2 node2" -> "rsc2_start_0 node2" [ style = bold] +"load_stopped_node2 node2" -> "rsc3_start_0 node2" [ style = bold] +"load_stopped_node2 node2" -> "rsc4_start_0 node2" [ style = bold] +"load_stopped_node2 node2" -> "rsc5_start_0 node2" [ style = bold] +"load_stopped_node2 node2" [ style=bold color="green" fontcolor="orange"] +"probe_complete node1" -> "probe_complete" [ style = bold] +"probe_complete node1" [ style=bold color="green" fontcolor="black"] +"probe_complete node2" -> "probe_complete" [ style = bold] +"probe_complete node2" [ style=bold color="green" fontcolor="black"] +"probe_complete" -> "rsc1_start_0 node2" [ style = bold] +"probe_complete" -> "rsc2_start_0 node2" [ style = bold] +"probe_complete" -> "rsc3_start_0 node2" [ style = bold] +"probe_complete" -> "rsc4_start_0 node2" [ style = bold] +"probe_complete" -> "rsc5_start_0 node2" [ style = bold] +"probe_complete" [ style=bold color="green" fontcolor="orange"] +"rsc1_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc1_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc1_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc1_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc1_start_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc2_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc2_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc2_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc2_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc2_start_0 node2" -> "group1_running_0" [ style = bold] +"rsc2_start_0 node2" -> "rsc3_start_0 node2" [ style = bold] +"rsc2_start_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc3_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc3_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc3_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc3_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc3_start_0 node2" -> "group1_running_0" [ style = bold] +"rsc3_start_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc4_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc4_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc4_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc4_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc4_start_0 node2" -> "group2_running_0" [ style = bold] +"rsc4_start_0 node2" -> "rsc5_start_0 node2" [ style = bold] +"rsc4_start_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc5_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc5_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc5_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc5_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc5_start_0 node2" -> "group2_running_0" [ style = bold] +"rsc5_start_0 node2" [ style=bold color="green" fontcolor="black"] +} diff --git a/pengine/test10/colocated-utilization-group.exp b/pengine/test10/colocated-utilization-group.exp new file mode 100644 index 00000000000..3d814f68486 --- /dev/null +++ b/pengine/test10/colocated-utilization-group.exp @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/test10/colocated-utilization-group.scores b/pengine/test10/colocated-utilization-group.scores new file mode 100644 index 00000000000..fe0bb5290b2 --- /dev/null +++ b/pengine/test10/colocated-utilization-group.scores @@ -0,0 +1,23 @@ +Allocation scores: +group_color: group1 allocation score on node1: 0 +group_color: group1 allocation score on node2: 0 +group_color: group2 allocation score on node1: 0 +group_color: group2 allocation score on node2: 0 +group_color: rsc2 allocation score on node1: 0 +group_color: rsc2 allocation score on node2: 0 +group_color: rsc3 allocation score on node1: 0 +group_color: rsc3 allocation score on node2: 0 +group_color: rsc4 allocation score on node1: 0 +group_color: rsc4 allocation score on node2: 0 +group_color: rsc5 allocation score on node1: 0 +group_color: rsc5 allocation score on node2: 0 +native_color: rsc1 allocation score on node1: 0 +native_color: rsc1 allocation score on node2: 0 +native_color: rsc2 allocation score on node1: -INFINITY +native_color: rsc2 allocation score on node2: 0 +native_color: rsc3 allocation score on node1: -INFINITY +native_color: rsc3 allocation score on node2: 0 +native_color: rsc4 allocation score on node1: -INFINITY +native_color: rsc4 allocation score on node2: 0 +native_color: rsc5 allocation score on node1: -INFINITY +native_color: rsc5 allocation score on node2: 0 diff --git a/pengine/test10/colocated-utilization-group.summary b/pengine/test10/colocated-utilization-group.summary new file mode 100644 index 00000000000..794960d46fb --- /dev/null +++ b/pengine/test10/colocated-utilization-group.summary @@ -0,0 +1,54 @@ + +Current cluster status: +Online: [ node1 node2 ] + + rsc1 (ocf::pacemaker:Dummy): Stopped + Resource Group: group1 + rsc2 (ocf::pacemaker:Dummy): Stopped + rsc3 (ocf::pacemaker:Dummy): Stopped + Resource Group: group2 + rsc4 (ocf::pacemaker:Dummy): Stopped + rsc5 (ocf::pacemaker:Dummy): Stopped + +Transition Summary: + * Start rsc1 (node2) + * Start rsc2 (node2) + * Start rsc3 (node2) + * Start rsc4 (node2) + * Start rsc5 (node2) + +Executing cluster transition: + * Resource action: rsc1 monitor on node2 + * Resource action: rsc1 monitor on node1 + * Pseudo action: group1_start_0 + * Resource action: rsc2 monitor on node2 + * Resource action: rsc2 monitor on node1 + * Resource action: rsc3 monitor on node2 + * Resource action: rsc3 monitor on node1 + * Pseudo action: group2_start_0 + * Resource action: rsc4 monitor on node2 + * Resource action: rsc4 monitor on node1 + * Resource action: rsc5 monitor on node2 + * Resource action: rsc5 monitor on node1 + * Pseudo action: probe_complete + * Pseudo action: load_stopped_node1 + * Pseudo action: load_stopped_node2 + * Resource action: rsc1 start on node2 + * Resource action: rsc2 start on node2 + * Resource action: rsc3 start on node2 + * Resource action: rsc4 start on node2 + * Resource action: rsc5 start on node2 + * Pseudo action: group1_running_0 + * Pseudo action: group2_running_0 + +Revised cluster status: +Online: [ node1 node2 ] + + rsc1 (ocf::pacemaker:Dummy): Started node2 + Resource Group: group1 + rsc2 (ocf::pacemaker:Dummy): Started node2 + rsc3 (ocf::pacemaker:Dummy): Started node2 + Resource Group: group2 + rsc4 (ocf::pacemaker:Dummy): Started node2 + rsc5 (ocf::pacemaker:Dummy): Started node2 + diff --git a/pengine/test10/colocated-utilization-group.xml b/pengine/test10/colocated-utilization-group.xml new file mode 100644 index 00000000000..4b447e012f3 --- /dev/null +++ b/pengine/test10/colocated-utilization-group.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/test10/colocated-utilization-primitive-1.dot b/pengine/test10/colocated-utilization-primitive-1.dot new file mode 100644 index 00000000000..ed45a91da2b --- /dev/null +++ b/pengine/test10/colocated-utilization-primitive-1.dot @@ -0,0 +1,30 @@ +digraph "g" { +"load_stopped_node1 node1" [ style=bold color="green" fontcolor="orange"] +"load_stopped_node2 node2" -> "rsc1_start_0 node2" [ style = bold] +"load_stopped_node2 node2" -> "rsc2_start_0 node2" [ style = bold] +"load_stopped_node2 node2" -> "rsc3_start_0 node2" [ style = bold] +"load_stopped_node2 node2" [ style=bold color="green" fontcolor="orange"] +"probe_complete node1" -> "probe_complete" [ style = bold] +"probe_complete node1" [ style=bold color="green" fontcolor="black"] +"probe_complete node2" -> "probe_complete" [ style = bold] +"probe_complete node2" [ style=bold color="green" fontcolor="black"] +"probe_complete" -> "rsc1_start_0 node2" [ style = bold] +"probe_complete" -> "rsc2_start_0 node2" [ style = bold] +"probe_complete" -> "rsc3_start_0 node2" [ style = bold] +"probe_complete" [ style=bold color="green" fontcolor="orange"] +"rsc1_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc1_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc1_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc1_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc1_start_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc2_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc2_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc2_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc2_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc2_start_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc3_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc3_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc3_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc3_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc3_start_0 node2" [ style=bold color="green" fontcolor="black"] +} diff --git a/pengine/test10/colocated-utilization-primitive-1.exp b/pengine/test10/colocated-utilization-primitive-1.exp new file mode 100644 index 00000000000..8bee4963926 --- /dev/null +++ b/pengine/test10/colocated-utilization-primitive-1.exp @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/test10/colocated-utilization-primitive-1.scores b/pengine/test10/colocated-utilization-primitive-1.scores new file mode 100644 index 00000000000..fb6da06a91e --- /dev/null +++ b/pengine/test10/colocated-utilization-primitive-1.scores @@ -0,0 +1,7 @@ +Allocation scores: +native_color: rsc1 allocation score on node1: 0 +native_color: rsc1 allocation score on node2: 0 +native_color: rsc2 allocation score on node1: -INFINITY +native_color: rsc2 allocation score on node2: 0 +native_color: rsc3 allocation score on node1: -INFINITY +native_color: rsc3 allocation score on node2: 0 diff --git a/pengine/test10/colocated-utilization-primitive-1.summary b/pengine/test10/colocated-utilization-primitive-1.summary new file mode 100644 index 00000000000..38a2fbe42e8 --- /dev/null +++ b/pengine/test10/colocated-utilization-primitive-1.summary @@ -0,0 +1,34 @@ + +Current cluster status: +Online: [ node1 node2 ] + + rsc1 (ocf::pacemaker:Dummy): Stopped + rsc2 (ocf::pacemaker:Dummy): Stopped + rsc3 (ocf::pacemaker:Dummy): Stopped + +Transition Summary: + * Start rsc1 (node2) + * Start rsc2 (node2) + * Start rsc3 (node2) + +Executing cluster transition: + * Resource action: rsc1 monitor on node2 + * Resource action: rsc1 monitor on node1 + * Resource action: rsc2 monitor on node2 + * Resource action: rsc2 monitor on node1 + * Resource action: rsc3 monitor on node2 + * Resource action: rsc3 monitor on node1 + * Pseudo action: probe_complete + * Pseudo action: load_stopped_node1 + * Pseudo action: load_stopped_node2 + * Resource action: rsc1 start on node2 + * Resource action: rsc2 start on node2 + * Resource action: rsc3 start on node2 + +Revised cluster status: +Online: [ node1 node2 ] + + rsc1 (ocf::pacemaker:Dummy): Started node2 + rsc2 (ocf::pacemaker:Dummy): Started node2 + rsc3 (ocf::pacemaker:Dummy): Started node2 + diff --git a/pengine/test10/colocated-utilization-primitive-1.xml b/pengine/test10/colocated-utilization-primitive-1.xml new file mode 100644 index 00000000000..f3ef3c55439 --- /dev/null +++ b/pengine/test10/colocated-utilization-primitive-1.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/test10/colocated-utilization-primitive-2.dot b/pengine/test10/colocated-utilization-primitive-2.dot new file mode 100644 index 00000000000..c7a47545d15 --- /dev/null +++ b/pengine/test10/colocated-utilization-primitive-2.dot @@ -0,0 +1,27 @@ +digraph "g" { +"load_stopped_node1 node1" [ style=bold color="green" fontcolor="orange"] +"load_stopped_node2 node2" -> "rsc1_start_0 node2" [ style = bold] +"load_stopped_node2 node2" -> "rsc3_start_0 node2" [ style = bold] +"load_stopped_node2 node2" [ style=bold color="green" fontcolor="orange"] +"probe_complete node1" -> "probe_complete" [ style = bold] +"probe_complete node1" [ style=bold color="green" fontcolor="black"] +"probe_complete node2" -> "probe_complete" [ style = bold] +"probe_complete node2" [ style=bold color="green" fontcolor="black"] +"probe_complete" -> "rsc1_start_0 node2" [ style = bold] +"probe_complete" -> "rsc3_start_0 node2" [ style = bold] +"probe_complete" [ style=bold color="green" fontcolor="orange"] +"rsc1_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc1_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc1_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc1_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc1_start_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc2_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc2_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc2_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc2_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc3_monitor_0 node1" -> "probe_complete node1" [ style = bold] +"rsc3_monitor_0 node1" [ style=bold color="green" fontcolor="black"] +"rsc3_monitor_0 node2" -> "probe_complete node2" [ style = bold] +"rsc3_monitor_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc3_start_0 node2" [ style=bold color="green" fontcolor="black"] +} diff --git a/pengine/test10/colocated-utilization-primitive-2.exp b/pengine/test10/colocated-utilization-primitive-2.exp new file mode 100644 index 00000000000..b4dd1fcec13 --- /dev/null +++ b/pengine/test10/colocated-utilization-primitive-2.exp @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/test10/colocated-utilization-primitive-2.scores b/pengine/test10/colocated-utilization-primitive-2.scores new file mode 100644 index 00000000000..fb6da06a91e --- /dev/null +++ b/pengine/test10/colocated-utilization-primitive-2.scores @@ -0,0 +1,7 @@ +Allocation scores: +native_color: rsc1 allocation score on node1: 0 +native_color: rsc1 allocation score on node2: 0 +native_color: rsc2 allocation score on node1: -INFINITY +native_color: rsc2 allocation score on node2: 0 +native_color: rsc3 allocation score on node1: -INFINITY +native_color: rsc3 allocation score on node2: 0 diff --git a/pengine/test10/colocated-utilization-primitive-2.summary b/pengine/test10/colocated-utilization-primitive-2.summary new file mode 100644 index 00000000000..61446b1cf15 --- /dev/null +++ b/pengine/test10/colocated-utilization-primitive-2.summary @@ -0,0 +1,32 @@ + +Current cluster status: +Online: [ node1 node2 ] + + rsc3 (ocf::pacemaker:Dummy): Stopped + rsc1 (ocf::pacemaker:Dummy): Stopped + rsc2 (ocf::pacemaker:Dummy): Stopped + +Transition Summary: + * Start rsc3 (node2) + * Start rsc1 (node2) + +Executing cluster transition: + * Resource action: rsc3 monitor on node2 + * Resource action: rsc3 monitor on node1 + * Resource action: rsc1 monitor on node2 + * Resource action: rsc1 monitor on node1 + * Resource action: rsc2 monitor on node2 + * Resource action: rsc2 monitor on node1 + * Pseudo action: probe_complete + * Pseudo action: load_stopped_node1 + * Pseudo action: load_stopped_node2 + * Resource action: rsc3 start on node2 + * Resource action: rsc1 start on node2 + +Revised cluster status: +Online: [ node1 node2 ] + + rsc3 (ocf::pacemaker:Dummy): Started node2 + rsc1 (ocf::pacemaker:Dummy): Started node2 + rsc2 (ocf::pacemaker:Dummy): Stopped + diff --git a/pengine/test10/colocated-utilization-primitive-2.xml b/pengine/test10/colocated-utilization-primitive-2.xml new file mode 100644 index 00000000000..eab87817385 --- /dev/null +++ b/pengine/test10/colocated-utilization-primitive-2.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/utilization.c b/pengine/utilization.c new file mode 100644 index 00000000000..982fcc96b42 --- /dev/null +++ b/pengine/utilization.c @@ -0,0 +1,472 @@ +/* + * Copyright (C) 2014 Gao,Yan + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include + +static GListPtr find_colocated_rscs(GListPtr colocated_rscs, resource_t * rsc, + resource_t * orig_rsc); + +static GListPtr group_find_colocated_rscs(GListPtr colocated_rscs, resource_t * rsc, + resource_t * orig_rsc); + +static void group_add_unallocated_utilization(GHashTable * all_utilization, resource_t * rsc, + GListPtr all_rscs); + +struct compare_data { + const node_t *node1; + const node_t *node2; + int result; +}; + +static void +do_compare_capacity1(gpointer key, gpointer value, gpointer user_data) +{ + int node1_capacity = 0; + int node2_capacity = 0; + struct compare_data *data = user_data; + + node1_capacity = crm_parse_int(value, "0"); + node2_capacity = + crm_parse_int(g_hash_table_lookup(data->node2->details->utilization, key), "0"); + + if (node1_capacity > node2_capacity) { + data->result--; + } else if (node1_capacity < node2_capacity) { + data->result++; + } +} + +static void +do_compare_capacity2(gpointer key, gpointer value, gpointer user_data) +{ + int node1_capacity = 0; + int node2_capacity = 0; + struct compare_data *data = user_data; + + if (g_hash_table_lookup_extended(data->node1->details->utilization, key, NULL, NULL)) { + return; + } + + node1_capacity = 0; + node2_capacity = crm_parse_int(value, "0"); + + if (node1_capacity > node2_capacity) { + data->result--; + } else if (node1_capacity < node2_capacity) { + data->result++; + } +} + +/* rc < 0 if 'node1' has more capacity remaining + * rc > 0 if 'node1' has less capacity remaining + */ +int +compare_capacity(const node_t * node1, const node_t * node2) +{ + struct compare_data data; + + data.node1 = node1; + data.node2 = node2; + data.result = 0; + + g_hash_table_foreach(node1->details->utilization, do_compare_capacity1, &data); + g_hash_table_foreach(node2->details->utilization, do_compare_capacity2, &data); + + return data.result; +} + +struct calculate_data { + GHashTable *current_utilization; + gboolean plus; +}; + +static void +do_calculate_utilization(gpointer key, gpointer value, gpointer user_data) +{ + const char *current = NULL; + char *result = NULL; + struct calculate_data *data = user_data; + + current = g_hash_table_lookup(data->current_utilization, key); + if (data->plus) { + result = crm_itoa(crm_parse_int(current, "0") + crm_parse_int(value, "0")); + g_hash_table_replace(data->current_utilization, strdup(key), result); + + } else if (current) { + result = crm_itoa(crm_parse_int(current, "0") - crm_parse_int(value, "0")); + g_hash_table_replace(data->current_utilization, strdup(key), result); + } +} + +/* Specify 'plus' to FALSE when allocating + * Otherwise to TRUE when deallocating + */ +void +calculate_utilization(GHashTable * current_utilization, + GHashTable * utilization, gboolean plus) +{ + struct calculate_data data; + + data.current_utilization = current_utilization; + data.plus = plus; + + g_hash_table_foreach(utilization, do_calculate_utilization, &data); +} + + +struct capacity_data { + node_t *node; + const char *rsc_id; + gboolean is_enough; +}; + +static void +check_capacity(gpointer key, gpointer value, gpointer user_data) +{ + int required = 0; + int remaining = 0; + struct capacity_data *data = user_data; + + required = crm_parse_int(value, "0"); + remaining = crm_parse_int(g_hash_table_lookup(data->node->details->utilization, key), "0"); + + if (required > remaining) { + CRM_ASSERT(data->rsc_id); + CRM_ASSERT(data->node); + + crm_debug("Node %s has no enough %s for %s: required=%d remaining=%d", + data->node->details->uname, (char *)key, data->rsc_id, required, remaining); + data->is_enough = FALSE; + } +} + +static gboolean +have_enough_capacity(node_t * node, const char * rsc_id, GHashTable * utilization) +{ + struct capacity_data data; + + data.node = node; + data.rsc_id = rsc_id; + data.is_enough = TRUE; + + g_hash_table_foreach(utilization, check_capacity, &data); + + return data.is_enough; +} + + +static void +native_add_unallocated_utilization(GHashTable * all_utilization, resource_t * rsc) +{ + if(is_set(rsc->flags, pe_rsc_provisional) == FALSE) { + return; + } + + calculate_utilization(all_utilization, rsc->utilization, TRUE); +} + +static void +add_unallocated_utilization(GHashTable * all_utilization, resource_t * rsc, + GListPtr all_rscs, resource_t * orig_rsc) +{ + if(is_set(rsc->flags, pe_rsc_provisional) == FALSE) { + return; + } + + if (rsc->variant == pe_native) { + pe_rsc_trace(orig_rsc, "%s: Adding %s as colocated utilization", + orig_rsc->id, rsc->id); + native_add_unallocated_utilization(all_utilization, rsc); + + } else if (rsc->variant == pe_group) { + pe_rsc_trace(orig_rsc, "%s: Adding %s as colocated utilization", + orig_rsc->id, rsc->id); + group_add_unallocated_utilization(all_utilization, rsc, all_rscs); + + } else if (rsc->variant == pe_clone || + rsc->variant == pe_master) { + GListPtr gIter1 = NULL; + gboolean existing = FALSE; + + /* Check if there's any child already existing in the list */ + gIter1 = rsc->children; + for (; gIter1 != NULL; gIter1 = gIter1->next) { + resource_t *child = (resource_t *) gIter1->data; + GListPtr gIter2 = NULL; + + if (g_list_find(all_rscs, child)) { + existing = TRUE; + + } else { + /* Check if there's any child of another cloned group already existing in the list */ + gIter2 = child->children; + for (; gIter2 != NULL; gIter2 = gIter2->next) { + resource_t *grandchild = (resource_t *) gIter2->data; + + if (g_list_find(all_rscs, grandchild)) { + pe_rsc_trace(orig_rsc, "%s: Adding %s as colocated utilization", + orig_rsc->id, child->id); + add_unallocated_utilization(all_utilization, child, all_rscs, orig_rsc); + existing = TRUE; + break; + } + } + } + } + + if (existing == FALSE) { + resource_t *first_child = (resource_t *) rsc->children->data; + + pe_rsc_trace(orig_rsc, "%s: Adding %s as colocated utilization", + orig_rsc->id, ID(first_child->xml)); + add_unallocated_utilization(all_utilization, first_child, all_rscs, orig_rsc); + } + } +} + +static GHashTable * +sum_unallocated_utilization(resource_t * rsc, GListPtr colocated_rscs) +{ + GListPtr gIter = NULL; + GListPtr all_rscs = NULL; + GHashTable *all_utilization = g_hash_table_new_full(crm_str_hash, g_str_equal, + g_hash_destroy_str, g_hash_destroy_str); + + all_rscs = g_list_copy(colocated_rscs); + if (g_list_find(all_rscs, rsc) == FALSE) { + all_rscs = g_list_append(all_rscs, rsc); + } + + for (gIter = all_rscs; gIter != NULL; gIter = gIter->next) { + resource_t *listed_rsc = (resource_t *) gIter->data; + + if(is_set(listed_rsc->flags, pe_rsc_provisional) == FALSE) { + continue; + } + + pe_rsc_trace(rsc, "%s: Processing unallocated colocated %s", rsc->id, listed_rsc->id); + add_unallocated_utilization(all_utilization, listed_rsc, all_rscs, rsc); + } + + g_list_free(all_rscs); + + return all_utilization; +} + +static GListPtr +find_colocated_rscs(GListPtr colocated_rscs, resource_t * rsc, resource_t * orig_rsc) +{ + GListPtr gIter = NULL; + + if (rsc == NULL) { + return colocated_rscs; + + } else if (g_list_find(colocated_rscs, rsc)) { + return colocated_rscs; + } + + crm_trace("%s: %s is supposed to be colocated with %s", orig_rsc->id, rsc->id, orig_rsc->id); + colocated_rscs = g_list_append(colocated_rscs, rsc); + + for (gIter = rsc->rsc_cons; gIter != NULL; gIter = gIter->next) { + rsc_colocation_t *constraint = (rsc_colocation_t *) gIter->data; + resource_t *rsc_rh = constraint->rsc_rh; + + /* Break colocation loop */ + if (rsc_rh == orig_rsc) { + continue; + } + + if (constraint->score == INFINITY + && filter_colocation_constraint(rsc, rsc_rh, constraint, TRUE) == influence_rsc_location) { + + if (rsc_rh->variant == pe_group) { + /* Need to use group_variant_data */ + colocated_rscs = group_find_colocated_rscs(colocated_rscs, rsc_rh, orig_rsc); + + } else { + colocated_rscs = find_colocated_rscs(colocated_rscs, rsc_rh, orig_rsc); + } + } + } + + for (gIter = rsc->rsc_cons_lhs; gIter != NULL; gIter = gIter->next) { + rsc_colocation_t *constraint = (rsc_colocation_t *) gIter->data; + resource_t *rsc_lh = constraint->rsc_lh; + + /* Break colocation loop */ + if (rsc_lh == orig_rsc) { + continue; + } + + if (rsc_lh->variant <= pe_group && rsc->variant > pe_group) { + /* We do not know if rsc_lh will be colocated with orig_rsc in this case */ + continue; + } + + if (constraint->score == INFINITY + && filter_colocation_constraint(rsc_lh, rsc, constraint, TRUE) == influence_rsc_location) { + + if (rsc_lh->variant == pe_group) { + /* Need to use group_variant_data */ + colocated_rscs = group_find_colocated_rscs(colocated_rscs, rsc_lh, orig_rsc); + + } else { + colocated_rscs = find_colocated_rscs(colocated_rscs, rsc_lh, orig_rsc); + } + } + } + + return colocated_rscs; +} + +void +process_utilization(resource_t * rsc, node_t ** prefer, pe_working_set_t * data_set) +{ + int alloc_details = scores_log_level + 1; + + if (safe_str_neq(data_set->placement_strategy, "default")) { + GListPtr gIter = NULL; + GListPtr colocated_rscs = NULL; + gboolean any_capable = FALSE; + + colocated_rscs = find_colocated_rscs(colocated_rscs, rsc, rsc); + if (colocated_rscs) { + GHashTable *unallocated_utilization = NULL; + char *rscs_id = crm_concat(rsc->id, "and its colocated resources", ' '); + node_t *most_capable_node = NULL; + + unallocated_utilization = sum_unallocated_utilization(rsc, colocated_rscs); + + for (gIter = data_set->nodes; gIter != NULL; gIter = gIter->next) { + node_t *node = (node_t *) gIter->data; + + if (have_enough_capacity(node, rscs_id, unallocated_utilization)) { + any_capable = TRUE; + } + + if (most_capable_node == NULL || + compare_capacity(node, most_capable_node) < 0) { + /* < 0 means 'node' is more capable */ + most_capable_node = node; + } + } + + if (any_capable) { + for (gIter = data_set->nodes; gIter != NULL; gIter = gIter->next) { + node_t *node = (node_t *) gIter->data; + + if (have_enough_capacity(node, rscs_id, unallocated_utilization) == FALSE) { + pe_rsc_debug(rsc, "Resource %s and its colocated resources cannot be allocated to node %s: no enough capacity", + rsc->id, node->details->uname); + resource_location(rsc, node, -INFINITY, "__limit_utilization__", data_set); + } + } + + } else if (*prefer == NULL) { + *prefer = most_capable_node; + } + + if (unallocated_utilization) { + g_hash_table_destroy(unallocated_utilization); + } + + g_list_free(colocated_rscs); + free(rscs_id); + } + + if (any_capable == FALSE) { + for (gIter = data_set->nodes; gIter != NULL; gIter = gIter->next) { + node_t *node = (node_t *) gIter->data; + + if (have_enough_capacity(node, rsc->id, rsc->utilization) == FALSE) { + pe_rsc_debug(rsc, "Resource %s cannot be allocated to node %s: no enough capacity", + rsc->id, node->details->uname); + resource_location(rsc, node, -INFINITY, "__limit_utilization__", data_set); + } + } + } + dump_node_scores(alloc_details, rsc, "Post-utilization", rsc->allowed_nodes); + } +} + +#define VARIANT_GROUP 1 +#include + +GListPtr +group_find_colocated_rscs(GListPtr colocated_rscs, resource_t * rsc, resource_t * orig_rsc) +{ + group_variant_data_t *group_data = NULL; + + get_group_variant_data(group_data, rsc); + if (group_data->colocated || + (rsc->parent && + (rsc->parent->variant == pe_clone || rsc->parent->variant == pe_master))) { + GListPtr gIter = rsc->children; + + for (; gIter != NULL; gIter = gIter->next) { + resource_t *child_rsc = (resource_t *) gIter->data; + + colocated_rscs = find_colocated_rscs(colocated_rscs, child_rsc, orig_rsc); + } + + } else { + if (group_data->first_child) { + colocated_rscs = find_colocated_rscs(colocated_rscs, group_data->first_child, orig_rsc); + } + } + + colocated_rscs = find_colocated_rscs(colocated_rscs, rsc, orig_rsc); + + return colocated_rscs; +} + +static void +group_add_unallocated_utilization(GHashTable * all_utilization, resource_t * rsc, + GListPtr all_rscs) +{ + group_variant_data_t *group_data = NULL; + + get_group_variant_data(group_data, rsc); + if (group_data->colocated || + (rsc->parent && + (rsc->parent->variant == pe_clone || rsc->parent->variant == pe_master))) { + GListPtr gIter = rsc->children; + + for (; gIter != NULL; gIter = gIter->next) { + resource_t *child_rsc = (resource_t *) gIter->data; + + if (is_set(child_rsc->flags, pe_rsc_provisional) && + g_list_find(all_rscs, child_rsc) == FALSE) { + native_add_unallocated_utilization(all_utilization, child_rsc); + } + } + + } else { + if (group_data->first_child && + is_set(group_data->first_child->flags, pe_rsc_provisional) && + g_list_find(all_rscs, group_data->first_child) == FALSE) { + native_add_unallocated_utilization(all_utilization, group_data->first_child); + } + } +} + + diff --git a/pengine/utils.c b/pengine/utils.c index 9782cb61446..e1c368517f9 100644 --- a/pengine/utils.c +++ b/pengine/utils.c @@ -129,69 +129,6 @@ can_run_resources(const node_t * node) return TRUE; } -struct compare_data { - const node_t *node1; - const node_t *node2; - int result; -}; - -static void -do_compare_capacity1(gpointer key, gpointer value, gpointer user_data) -{ - int node1_capacity = 0; - int node2_capacity = 0; - struct compare_data *data = user_data; - - node1_capacity = crm_parse_int(value, "0"); - node2_capacity = - crm_parse_int(g_hash_table_lookup(data->node2->details->utilization, key), "0"); - - if (node1_capacity > node2_capacity) { - data->result--; - } else if (node1_capacity < node2_capacity) { - data->result++; - } -} - -static void -do_compare_capacity2(gpointer key, gpointer value, gpointer user_data) -{ - int node1_capacity = 0; - int node2_capacity = 0; - struct compare_data *data = user_data; - - if (g_hash_table_lookup_extended(data->node1->details->utilization, key, NULL, NULL)) { - return; - } - - node1_capacity = 0; - node2_capacity = crm_parse_int(value, "0"); - - if (node1_capacity > node2_capacity) { - data->result--; - } else if (node1_capacity < node2_capacity) { - data->result++; - } -} - -/* rc < 0 if 'node1' has more capacity remaining - * rc > 0 if 'node1' has less capacity remaining - */ -static int -compare_capacity(const node_t * node1, const node_t * node2) -{ - struct compare_data data; - - data.node1 = node1; - data.node2 = node2; - data.result = 0; - - g_hash_table_foreach(node1->details->utilization, do_compare_capacity1, &data); - g_hash_table_foreach(node2->details->utilization, do_compare_capacity2, &data); - - return data.result; -} - /* return -1 if 'a' is more preferred * return 1 if 'b' is more preferred */ @@ -281,47 +218,6 @@ sort_node_weight(gconstpointer a, gconstpointer b, gpointer data) return strcmp(node1->details->uname, node2->details->uname); } -struct calculate_data { - node_t *node; - gboolean allocate; -}; - -static void -do_calculate_utilization(gpointer key, gpointer value, gpointer user_data) -{ - const char *capacity = NULL; - char *remain_capacity = NULL; - struct calculate_data *data = user_data; - - capacity = g_hash_table_lookup(data->node->details->utilization, key); - if (capacity) { - if (data->allocate) { - remain_capacity = crm_itoa(crm_parse_int(capacity, "0") - crm_parse_int(value, "0")); - } else { - remain_capacity = crm_itoa(crm_parse_int(capacity, "0") + crm_parse_int(value, "0")); - } - g_hash_table_replace(data->node->details->utilization, strdup(key), remain_capacity); - } -} - -/* Specify 'allocate' to TRUE when allocating - * Otherwise to FALSE when deallocating - */ -static void -calculate_utilization(node_t * node, resource_t * rsc, gboolean allocate) -{ - struct calculate_data data; - - data.node = node; - data.allocate = allocate; - - g_hash_table_foreach(rsc->utilization, do_calculate_utilization, &data); - - if (allocate) { - dump_rsc_utilization(show_utilization ? 0 : utilization_log_level, __FUNCTION__, rsc, node); - } -} - void native_deallocate(resource_t * rsc) { @@ -335,7 +231,7 @@ native_deallocate(resource_t * rsc) old->details->allocated_rsc = g_list_remove(old->details->allocated_rsc, rsc); old->details->num_resources--; /* old->count--; */ - calculate_utilization(old, rsc, FALSE); + calculate_utilization(old->details->utilization, rsc->utilization, TRUE); free(old); } } @@ -402,7 +298,9 @@ native_assign_node(resource_t * rsc, GListPtr nodes, node_t * chosen, gboolean f chosen->details->allocated_rsc = g_list_prepend(chosen->details->allocated_rsc, rsc); chosen->details->num_resources++; chosen->count++; - calculate_utilization(chosen, rsc, TRUE); + calculate_utilization(chosen->details->utilization, rsc->utilization, FALSE); + dump_rsc_utilization(show_utilization ? 0 : utilization_log_level, __FUNCTION__, rsc, chosen); + return TRUE; } diff --git a/pengine/utils.h b/pengine/utils.h index 270d32a4fe3..f579aa247cd 100644 --- a/pengine/utils.h +++ b/pengine/utils.h @@ -53,6 +53,23 @@ extern gboolean can_run_any(GHashTable * nodes); extern resource_t *find_compatible_child(resource_t * local_child, resource_t * rsc, enum rsc_role_e filter, gboolean current); + +enum filter_colocation_res { + influence_nothing = 0, + influence_rsc_location, + influence_rsc_priority, +}; + +extern enum filter_colocation_res +filter_colocation_constraint(resource_t * rsc_lh, resource_t * rsc_rh, + rsc_colocation_t * constraint, gboolean preview); + +extern int compare_capacity(const node_t * node1, const node_t * node2); +extern void calculate_utilization(GHashTable * current_utilization, + GHashTable * utilization, gboolean plus); + +extern void process_utilization(resource_t * rsc, node_t ** prefer, pe_working_set_t * data_set); + # define STONITH_UP "stonith_up" # define STONITH_DONE "stonith_complete" # define ALL_STOPPED "all_stopped" diff --git a/rpmlintrc b/rpmlintrc index 8b93c40e270..75b27879717 100644 --- a/rpmlintrc +++ b/rpmlintrc @@ -1,14 +1,29 @@ addFilter("E: non-standard-dir-perm .* 0750") -addFilter("E: hardcoded-library-path in /usr/lib/ocf") -addFilter("E: changelog-time-in-future") -addFilter("W: spelling-error") -addFilter("W: non-standard-uid .* hacluster") -addFilter("W: non-standard-gid .* haclient") addFilter("W: shared-lib-calls-exit") + +# Really, really do not care +addFilter("spelling-error") +addFilter("mixed-use-of-spaces-and-tabs") + +# Mandated location for OCF directory +addFilter("W: only-non-binary-in-usr-lib") +addFilter("E: hardcoded-library-path in /usr/lib/ocf") + +# Its there but rpmlint can't find it for some reason +addFilter("no-status-entry /etc/rc.d/init.d/") + +# We don't want the cluster to start by default +addFilter("no-chkconfig-line /etc/rc.d/init.d/") + +# Not interested in lock files +addFilter("subsys-not-used /etc/rc.d/init.d/") + +# When building developer packages addFilter("W: invalid-url Source0:") -addFilter("pacemaker.src: W: strange-permission .* 0600") -addFilter("W: mixed-use-of-spaces-and-tabs") addFilter("W: unstripped-binary-or-object") addFilter("W: hidden-file-or-dir /var/lib/pacemaker/gcov") + +# Build artifacts +addFilter("E: changelog-time-in-future") +addFilter("pacemaker.src: W: strange-permission .* 0600") addFilter("enchant-dictionary-not-found en_US") -addFilter("W: only-non-binary-in-usr-lib")