Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=64…
Commit: 64ba5d035d8d477e0986e75c3d37e2625861bf9c
Parent: 07891324276c5414e6000b50bccafe9235bd4a4a
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Jan 5 10:43:12 2012 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Jan 5 11:33:05 2012 -0500
rgmanager: Fix dependency issue related to ordering
If you ordered two services the opposite way in cluster.conf
('b' first, which depends on 'a'), then rgmanager would fail
over 'b' despite the fact that 'a' was not running yet - this
is because the state of 'a' was not set to 'stopped' - so we
need to check for a node-death event in move_or_start().
Resolves: rhbz#743214
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/default_event_script.sl | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/resources/default_event_script.sl b/rgmanager/src/resources/default_event_script.sl
index f2c7bc1..62de2d2 100644
--- a/rgmanager/src/resources/default_event_script.sl
+++ b/rgmanager/src/resources/default_event_script.sl
@@ -156,7 +156,9 @@ define move_or_start(service, node_list)
depends = service_property(service, "depend");
if (depends != "") {
(,,, owner, state) = service_status(depends);
- if (owner < 0) {
+ if ((owner < 0) or
+ ((event_type == EVENT_NODE) and (owner == node_id) and
+ (node_state == 0))) {
debug(service, " is not runnable; dependency not met");
()=service_stop(service);
return ERR_DEPEND;
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=64…
Commit: 64f54ec761a16143c28fe414aa4fefef308bdc43
Parent: 93e33cb09d2567e9523a7098247c6c9df324c16b
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Jan 4 23:01:07 2012 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Jan 5 10:56:32 2012 -0500
rgmanager: Avoid duplicate restart of service
If B depends on A and both A and B are running on
node 1 and node 1 fails, the stop events generated
will inadvertently cause B to be restarted after
the initial failover.
This patch resolves this issue by comparing the
start times in central_processing mode.
A known limitation to this patch is that in order
for this patch to work correctly, the cluster nodes'
time must be approximately in sync.
Resolves: rhbz#743214
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/default_event_script.sl | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/resources/default_event_script.sl b/rgmanager/src/resources/default_event_script.sl
index cdde066..2d5503f 100644
--- a/rgmanager/src/resources/default_event_script.sl
+++ b/rgmanager/src/resources/default_event_script.sl
@@ -444,6 +444,8 @@ define default_service_event_handler()
variable tmp;
variable owner;
variable state;
+ variable d_trans, s_trans;
+ variable s_state;
debug("Executing default service event handler");
@@ -498,17 +500,32 @@ define default_service_event_handler()
continue;
}
- (,,, owner, state) = service_status(services[x]);
+ (d_trans,,,, owner, state) = service_status(services[x], 1);
if ((service_state == "started") and (owner < 0) and
(state == "stopped")) {
info("Dependency met; starting ", services[x]);
nodes = allowed_nodes(services[x]);
()=move_or_start(services[x], nodes);
+ continue;
}
% service died - stop service(s) that depend on the dead
if ((service_owner < 0) and (owner >= 0) and
(depend_mode != "soft")) {
+
+ % grab the -current- state of the service here
+ % If the service is running, and its dependent service
+ % as above is running and the dependent service was
+ % started at or after the service, then stopping it
+ % will result in unwanted service outage.
+ (s_trans,,,, s_state) = service_status(service_name);
+ if ((s_state == "started") and (state == "started") and
+ (d_trans >= s_trans)) {
+ debug("Skipping ", services[x],
+ "; restart not needed");
+ continue;
+ }
+
info("Dependency lost; stopping ", services[x]);
()=service_stop(services[x]);
}
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e6…
Commit: e66cf5f585812e24f5e82a424d50cc2a4fec039d
Parent: 8ce53c09ea6fe55b18ae15ad8620dd1873ff43cb
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Jan 5 10:43:12 2012 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Jan 5 11:31:48 2012 -0500
rgmanager: Fix dependency issue related to ordering
If you ordered two services the opposite way in cluster.conf
('b' first, which depends on 'a'), then rgmanager would fail
over 'b' despite the fact that 'a' was not running yet - this
is because the state of 'a' was not set to 'stopped' - so we
need to check for a node-death event in move_or_start().
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/default_event_script.sl | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/resources/default_event_script.sl b/rgmanager/src/resources/default_event_script.sl
index bd445c0..c54c068 100644
--- a/rgmanager/src/resources/default_event_script.sl
+++ b/rgmanager/src/resources/default_event_script.sl
@@ -176,7 +176,9 @@ define move_or_start(service, node_list)
depends = service_property(service, "depend");
if (depends != "") {
(,,, owner, state) = service_status(depends);
- if (owner < 0) {
+ if ((owner < 0) or
+ ((event_type == EVENT_NODE) and (owner == node_id) and
+ (node_state == 0))) {
debug(service, " is not runnable; dependency not met");
()=service_stop(service);
return ERR_DEPEND;
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4b…
Commit: 4b7a2a2cc9b87ec9e31d6d4b05ee11c5519deb41
Parent: 663efa987ba58aa79eb66dfdcdedbbd905886cf4
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Jan 5 10:43:12 2012 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Jan 5 10:53:32 2012 -0500
rgmanager: Fix dependency issue related to ordering
If you ordered two services the opposite way in cluster.conf
('b' first, which depends on 'a'), then rgmanager would fail
over 'b' despite the fact that 'a' was not running yet - this
is because the state of 'a' was not set to 'stopped' - so we
need to check for a node-death event in move_or_start().
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/default_event_script.sl | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/rgmanager/src/resources/default_event_script.sl b/rgmanager/src/resources/default_event_script.sl
index bd445c0..4cdf519 100644
--- a/rgmanager/src/resources/default_event_script.sl
+++ b/rgmanager/src/resources/default_event_script.sl
@@ -176,7 +176,9 @@ define move_or_start(service, node_list)
depends = service_property(service, "depend");
if (depends != "") {
(,,, owner, state) = service_status(depends);
- if (owner < 0) {
+ if ((owner < 0) or
+ ((event_type == EVENT_NODE) and (owner == node_id) and
+ (node_state == 0))) {
debug(service, " is not runnable; dependency not met");
()=service_stop(service);
return ERR_DEPEND;
@@ -541,8 +543,8 @@ define default_service_event_handler()
(s_trans,,,,,, s_state) = service_status(service_name, 1);
if ((s_state == "started") and (state == "started") and
(d_trans >= s_trans)) {
- %debug("S:", service_name, " trans ", s_trans);
- %debug("D:", services[x], " trans ", d_trans);
+ debug("S:", service_name, " trans ", s_trans);
+ debug("D:", services[x], " trans ", d_trans);
debug("Skipping ", services[x],
"; restart not needed");