cluster: STABLE3 - rgmanager: Fix corner case in critical/non-critical handling
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 6dc5ed853217fa44014d29f309b2bc90a2fa3f19
Parent: 1631855bb29f799d71a178dffb72f5debf8cbbee
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Sep 24 16:45:29 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Sep 24 18:17:22 2010 -0400
rgmanager: Fix corner case in critical/non-critical handling
If a subtree had failed and you removed
__independent_subtree from the configuration for that
subtree as part of a reconfiguration operation, the
subtree would fail to stop, causing the service to enter
the failed state.
Resolves: rhbz#605733
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/restree.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index 55cc146..9652c6e 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -1596,8 +1596,8 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
assert(node->rn_resource->r_incarnations >= 0);
if (node->rn_resource->r_incarnations > 0)
--node->rn_resource->r_incarnations;
- } else if (node->rn_state != RES_DISABLED &&
- !(node->rn_flags & RF_QUIESCE)) {
+ } else if (rv != 0 && (node->rn_state != RES_DISABLED &&
+ !(node->rn_flags & RF_QUIESCE))) {
node->rn_state = RES_FAILED;
pthread_mutex_unlock(&node->rn_resource->r_mutex);
return SFL_FAILURE;
13 years, 7 months
cluster: STABLE3 - rgmanager: clean up independent subtree restart handling
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 1631855bb29f799d71a178dffb72f5debf8cbbee
Parent: 4876dd567929506c2828b523607aaf48b567acfe
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Tue Sep 14 10:10:05 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Sep 24 18:17:22 2010 -0400
rgmanager: clean up independent subtree restart handling
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/restree.c | 28 ++++++++++++++++------------
rgmanager/src/daemons/rg_state.c | 11 +++++++----
2 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index 30c7179..55cc146 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -509,9 +509,6 @@ assign_restart_policy(resource_t *curres, resource_node_t *parent,
if (max_restarts <= 0)
max_restarts = 0;
free(val);
-
- if (!max_restarts)
- return;
}
snprintf(tok, sizeof(tok), "%s/@__restart_expire_time", base);
@@ -521,11 +518,13 @@ assign_restart_policy(resource_t *curres, resource_node_t *parent,
if (conf_get(tok, &val) == 0) {
#endif
restart_expire_time = (time_t)expand_time(val);
- if ((int64_t)restart_expire_time < 0)
+ if ((int64_t)restart_expire_time <= 0)
restart_expire_time = 0;
free(val);
}
+ if (restart_expire_time == 0 || max_restarts == 0)
+ return;
goto out_assign;
}
@@ -1511,7 +1510,8 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
RF_NEEDSTOP | RF_QUIESCE, 0);
restart_clear(node->rn_restart_counter);
return SFL_RECOVERABLE|SFL_PARTIAL;
- } else if (!rte) {
+ } else if (!rte ||
+ !node->rn_restart_counter) {
restart_add(node->rn_restart_counter);
mark_nodes(node, RES_FAILED,
RF_NEEDSTART | RF_NEEDSTOP, 0);
@@ -1552,7 +1552,7 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
mark_nodes(node, RES_FAILED, RF_NEEDSTOP | RF_QUIESCE, 0);
rv |= SFL_PARTIAL;
- } else if (!rte) {
+ } else if (!rte || !node->rn_restart_counter) {
restart_add(node->rn_restart_counter);
mark_nodes(node, RES_FAILED,
RF_NEEDSTOP | RF_NEEDSTART, 0);
@@ -1573,18 +1573,21 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
node->rn_flags &= ~RF_NEEDSTOP;
rv |= res_exec(node, op, NULL, 0);
- if (node->rn_flags & RF_QUIESCE) {
+ if (node->rn_flags & (RF_NEEDSTART|RF_QUIESCE) &&
+ node->rn_flags & RF_INDEPENDENT &&
+ node->rn_flags & RF_NON_CRITICAL) {
/* Non-critical resources = do not fail
* service if the resource fails to stop
*/
if (rv & SFL_FAILURE) {
- logt_print(LOG_WARNING, "Failure to stop %s:%s"
+ logt_print(LOG_WARNING, "Failed to stop subtree %s:%s"
" during non-critical recovery "
"operation\n",
node->rn_resource->r_rule->rr_type,
primary_attr_value(
node->rn_resource));
- rv &= ~SFL_FAILURE;
+ rv = SFL_PARTIAL;
+ node->rn_flags |= RF_QUIESCE;
}
}
@@ -1593,7 +1596,8 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
assert(node->rn_resource->r_incarnations >= 0);
if (node->rn_resource->r_incarnations > 0)
--node->rn_resource->r_incarnations;
- } else if (node->rn_state != RES_DISABLED) {
+ } else if (node->rn_state != RES_DISABLED &&
+ !(node->rn_flags & RF_QUIESCE)) {
node->rn_state = RES_FAILED;
pthread_mutex_unlock(&node->rn_resource->r_mutex);
return SFL_FAILURE;
@@ -1601,8 +1605,8 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
pthread_mutex_unlock(&node->rn_resource->r_mutex);
if (node->rn_flags & RF_QUIESCE) {
- node->rn_flags &= ~RF_QUIESCE;
- node->rn_state = RES_DISABLED;
+ mark_nodes(node, RES_DISABLED, 0,
+ RF_NEEDSTART|RF_QUIESCE);
} else {
node->rn_state = RES_STOPPED;
}
diff --git a/rgmanager/src/daemons/rg_state.c b/rgmanager/src/daemons/rg_state.c
index 51711f1..7072433 100644
--- a/rgmanager/src/daemons/rg_state.c
+++ b/rgmanager/src/daemons/rg_state.c
@@ -1247,17 +1247,20 @@ handle_started_status(const char *svcName, int ret,
"Attempting inline recovery\n", svcName);
ret2 = group_op(svcName, RG_CONDSTOP);
- if (!(ret2 & SFL_FAILURE)) {
- ret2 = group_op(svcName, RG_CONDSTART);
+ if (ret2 & SFL_PARTIAL) {
+ ret |= SFL_PARTIAL;
+ ret2 &= ~SFL_PARTIAL;
}
- if (ret2) {
+ if (!(ret2 & SFL_FAILURE)) {
+ ret2 = group_op(svcName, RG_CONDSTART);
+ } else {
logt_print(LOG_WARNING, "Inline recovery of %s failed\n",
svcName);
return ret;
}
- logt_print(LOG_NOTICE, "Inline recovery of %s succeeded\n",
+ logt_print(LOG_NOTICE, "Inline recovery of %s complete\n",
svcName);
if (ret & SFL_PARTIAL) {
logt_print(LOG_NOTICE, "Note: Some non-critical "
13 years, 7 months
cluster: STABLE3 - config: Add independent subtree restart tolerances
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 4876dd567929506c2828b523607aaf48b567acfe
Parent: c553446e6586bb4ad6d4cc8396bed6d83f4f0db2
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Sep 10 15:12:26 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Sep 24 18:17:22 2010 -0400
config: Add independent subtree restart tolerances
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
config/tools/xml/cluster.rng.in | 150 +++++++++++++++++++++++++++++++++++++++
1 files changed, 150 insertions(+), 0 deletions(-)
diff --git a/config/tools/xml/cluster.rng.in b/config/tools/xml/cluster.rng.in
index fad30ad..15c6172 100644
--- a/config/tools/xml/cluster.rng.in
+++ b/config/tools/xml/cluster.rng.in
@@ -999,6 +999,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1041,6 +1047,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1093,6 +1105,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1132,6 +1150,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1166,6 +1190,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1211,6 +1241,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1261,6 +1297,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1297,6 +1339,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1342,6 +1390,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1387,6 +1441,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1432,6 +1492,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1480,6 +1546,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1525,6 +1597,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1573,6 +1651,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1612,6 +1696,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1652,6 +1742,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1736,6 +1832,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1793,6 +1895,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1863,6 +1971,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1911,6 +2025,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1951,6 +2071,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1982,6 +2108,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -2018,6 +2150,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -2074,6 +2212,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -2115,6 +2259,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
13 years, 7 months
cluster: STABLE3 - rgmanager: Add failure tolerances to resources.rng
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: c553446e6586bb4ad6d4cc8396bed6d83f4f0db2
Parent: 46621ea8fc93a1b27eb06d5e35ee1c96d938792d
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Sep 10 15:12:08 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Sep 24 18:17:22 2010 -0400
rgmanager: Add failure tolerances to resources.rng
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index 425faa9..11782d7 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -39,6 +39,12 @@
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
13 years, 7 months
cluster: STABLE3 - rgmanager: Add independent subtree restart thresholds
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 46621ea8fc93a1b27eb06d5e35ee1c96d938792d
Parent: 298ad61e8504b0b9ca5d13b4b7a77f1ccec3a2bb
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Sep 10 14:45:15 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Sep 24 18:17:22 2010 -0400
rgmanager: Add independent subtree restart thresholds
__max_restarts => number of restarts to tolerate
__restart_expire_time => in the amount of time given here
__independent_subtree="1":
- after threshold is exceeded for the subtree, restart the
service
- if no threshold, never restart the service
__independent_subtree="2"
- after threshold is exceeded for the subtree, stop the
subtree
- if no threshold, stop the subtree on first failure
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/restree.c | 95 ++++++++++++++++++++++++++++++++-------
1 files changed, 79 insertions(+), 16 deletions(-)
diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index 8719791..30c7179 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -482,19 +482,53 @@ res_exec(resource_node_t *node, int op, const char *arg, int depth)
static inline void
assign_restart_policy(resource_t *curres, resource_node_t *parent,
- resource_node_t *node)
+ resource_node_t *node, int ccsfd, char *base)
{
char *val;
int max_restarts = 0;
time_t restart_expire_time = 0;
+ char tok[1024];
node->rn_restart_counter = NULL;
if (!curres || !node)
return;
- if (parent) /* Non-parents don't get one for now */
+ if (parent &&
+ !(node->rn_flags & RF_INDEPENDENT))
return;
+ if (node->rn_flags & RF_INDEPENDENT) {
+ /* per-resource-node failures / expire times */
+ snprintf(tok, sizeof(tok), "%s/@__max_restarts", base);
+#ifndef NO_CCS
+ if (ccs_get(ccsfd, tok, &val) == 0) {
+#else
+ if (conf_get(tok, &val) == 0) {
+#endif
+ max_restarts = atoi(val);
+ if (max_restarts <= 0)
+ max_restarts = 0;
+ free(val);
+
+ if (!max_restarts)
+ return;
+ }
+
+ snprintf(tok, sizeof(tok), "%s/@__restart_expire_time", base);
+#ifndef NO_CCS
+ if (ccs_get(ccsfd, tok, &val) == 0) {
+#else
+ if (conf_get(tok, &val) == 0) {
+#endif
+ restart_expire_time = (time_t)expand_time(val);
+ if ((int64_t)restart_expire_time < 0)
+ restart_expire_time = 0;
+ free(val);
+ }
+
+ goto out_assign;
+ }
+
val = (char *)res_attr_value(curres, "max_restarts");
if (!val)
return;
@@ -508,6 +542,7 @@ assign_restart_policy(resource_t *curres, resource_node_t *parent,
return;
}
+out_assign:
node->rn_restart_counter = restart_init(restart_expire_time,
max_restarts);
}
@@ -597,20 +632,25 @@ do_load_resource(int ccsfd, char *base,
node->rn_state = RES_STOPPED;
node->rn_flags = 0;
node->rn_actions = (resource_act_t *)act_dup(curres->r_actions);
- assign_restart_policy(curres, parent, node);
- snprintf(tok, sizeof(tok), "%s/@__independent_subtree", base);
+
+ if (parent) {
+ /* Independent subtree / non-critical for top-level is
+ * not useful and can interfere with restart thresholds for
+ * non critical resources */
+ snprintf(tok, sizeof(tok), "%s/@__independent_subtree", base);
#ifndef NO_CCS
- if (ccs_get(ccsfd, tok, &ref) == 0) {
+ if (ccs_get(ccsfd, tok, &ref) == 0) {
#else
- if (conf_get(tok, &ref) == 0) {
+ if (conf_get(tok, &ref) == 0) {
#endif
- if (atoi(ref) == 1 || strcasecmp(ref, "yes") == 0)
- node->rn_flags |= RF_INDEPENDENT;
- if (atoi(ref) == 2 || strcasecmp(ref, "non-critical") == 0) {
- curres->r_flags |= RF_NON_CRITICAL;
+ if (atoi(ref) == 1 || strcasecmp(ref, "yes") == 0)
+ node->rn_flags |= RF_INDEPENDENT;
+ if (atoi(ref) == 2 || strcasecmp(ref, "non-critical") == 0) {
+ curres->r_flags |= RF_NON_CRITICAL;
+ }
+ free(ref);
}
- free(ref);
}
snprintf(tok, sizeof(tok), "%s/@__enforce_timeouts", base);
@@ -668,8 +708,11 @@ do_load_resource(int ccsfd, char *base,
* resource is non-critical
*/
node->rn_flags |= RF_NON_CRITICAL | RF_INDEPENDENT;
+
}
+ assign_restart_policy(curres, parent, node, ccsfd, base);
+
*newnode = node;
list_insert(tree, node);
@@ -1337,7 +1380,7 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
char *type, void *__attribute__((unused))ret, int realop,
resource_node_t *node)
{
- int rv = 0, me, op;
+ int rv = 0, me, op, rte = 0;
/* Restore default operation. */
op = realop;
@@ -1403,6 +1446,10 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
/* Nothing to do - children are also disabled */
return 0;
+ if ((realop == RS_START || realop == RS_CONVALESCE) &&
+ node->rn_flags & RF_INDEPENDENT)
+ restart_clear(node->rn_restart_counter);
+
pthread_mutex_lock(&node->rn_resource->r_mutex);
if (node->rn_flags & RF_RECONFIG &&
@@ -1456,14 +1503,22 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
resources of this node must be restarted,
but siblings of this node are not affected. */
if (node->rn_flags & RF_INDEPENDENT) {
- if (node->rn_flags & RF_NON_CRITICAL) {
+
+ rte = restart_threshold_exceeded(node->rn_restart_counter);
+ if ((node->rn_flags & RF_NON_CRITICAL) && (rte ||
+ !node->rn_restart_counter)) {
mark_nodes(node, RES_FAILED,
RF_NEEDSTOP | RF_QUIESCE, 0);
+ restart_clear(node->rn_restart_counter);
return SFL_RECOVERABLE|SFL_PARTIAL;
- } else {
+ } else if (!rte) {
+ restart_add(node->rn_restart_counter);
mark_nodes(node, RES_FAILED,
RF_NEEDSTART | RF_NEEDSTOP, 0);
return SFL_RECOVERABLE;
+ } else {
+ restart_clear(node->rn_restart_counter);
+ return SFL_FAILURE;
}
}
@@ -1487,15 +1542,23 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
the resource tree. */
if (op == RS_STATUS && (rv & (SFL_FAILURE|SFL_RECOVERABLE)) &&
(node->rn_flags & RF_INDEPENDENT)) {
+
+ rte = restart_threshold_exceeded(node->rn_restart_counter);
+
rv = SFL_RECOVERABLE;
- if (node->rn_flags & RF_NON_CRITICAL) {
+ if ((node->rn_flags & RF_NON_CRITICAL) && (rte ||
+ !node->rn_restart_counter)) {
/* if non-critical, just stop */
mark_nodes(node, RES_FAILED, RF_NEEDSTOP | RF_QUIESCE, 0);
rv |= SFL_PARTIAL;
- } else {
+ } else if (!rte) {
+ restart_add(node->rn_restart_counter);
mark_nodes(node, RES_FAILED,
RF_NEEDSTOP | RF_NEEDSTART, 0);
+ } else {
+ restart_clear(node->rn_restart_counter);
+ rv = SFL_FAILURE;
}
}
}
13 years, 7 months
cluster: STABLE3 - rgmanager: Add -c option to man page & clusvcadm -h
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 298ad61e8504b0b9ca5d13b4b7a77f1ccec3a2bb
Parent: 770a3ec8d60576655c469500a05b3449ff2304c2
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Sep 10 11:49:10 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Sep 24 18:17:22 2010 -0400
rgmanager: Add -c option to man page & clusvcadm -h
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/man/clusvcadm.8 | 9 +++++++++
rgmanager/src/utils/clusvcadm.c | 3 +++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/rgmanager/man/clusvcadm.8 b/rgmanager/man/clusvcadm.8
index d1435ef..d5e09eb 100644
--- a/rgmanager/man/clusvcadm.8
+++ b/rgmanager/man/clusvcadm.8
@@ -33,6 +33,9 @@ clusvcadm \- Cluster User Service Administration Utility
.B [\-s
.I <service>
.B ]
+.B [\-c
+.I <service>
+.B ]
.B [\-v]
.SH "DESCRIPTION"
@@ -117,6 +120,12 @@ Stops the service named
service
until a member transition or until it is enabled again.
+.IP "\-c <service>"
+Attempt to convalesce the named
+.I
+service
+by restarting failed, non-critical components.
+
.IP \-v
Display version information and exit.
diff --git a/rgmanager/src/utils/clusvcadm.c b/rgmanager/src/utils/clusvcadm.c
index bd0723f..8d0b502 100644
--- a/rgmanager/src/utils/clusvcadm.c
+++ b/rgmanager/src/utils/clusvcadm.c
@@ -167,6 +167,9 @@ printf(" -Z <group> Freeze resource group. This prevents\n"
" stopping the whole service.\n");
printf(" -U <group> Unfreeze (thaw) resource group. Restores\n"
" a group to normal operation.\n");
+printf(" -c <group> Convalesce (repair, fix) resource group.\n"
+ " Attempts to start failed, non-critical \n"
+ " resources within a resource group.\n");
printf("Resource Group Locking (for cluster Shutdown / Debugging):\n");
printf(" -l Lock local resource group managers.\n"
13 years, 7 months
cluster: STABLE3 - rgmanager: Support convalesce w/ central_processing
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 770a3ec8d60576655c469500a05b3449ff2304c2
Parent: 7097cb971d5aa2d7bee6f2ac5bfd7e2db53c8f2d
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Sep 9 10:58:17 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Sep 24 18:17:22 2010 -0400
rgmanager: Support convalesce w/ central_processing
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/include/event.h | 1 +
rgmanager/src/daemons/service_op.c | 84 +++++++++++++++++++++++
rgmanager/src/daemons/slang_event.c | 18 +++++-
rgmanager/src/resources/default_event_script.sl | 4 +
4 files changed, 106 insertions(+), 1 deletions(-)
diff --git a/rgmanager/include/event.h b/rgmanager/include/event.h
index a9a8235..ad3fe39 100644
--- a/rgmanager/include/event.h
+++ b/rgmanager/include/event.h
@@ -124,6 +124,7 @@ void set_transition_throttling(int nsecs);
int service_op_start(char *svcName, int *target_list, int target_list_len,
int *new_owner);
int service_op_stop(char *svcName, int do_disable, int event_type);
+int service_op_convalesce(const char *svcName);
int service_op_migrate(char *svcName, int target_node);
diff --git a/rgmanager/src/daemons/service_op.c b/rgmanager/src/daemons/service_op.c
index 112b267..f094129 100644
--- a/rgmanager/src/daemons/service_op.c
+++ b/rgmanager/src/daemons/service_op.c
@@ -186,6 +186,90 @@ service_op_stop(char *svcName, int do_disable, int event_type)
}
+int
+service_op_convalesce(const char *svcName)
+{
+ SmMessageSt msg;
+ int msg_ret;
+ msgctx_t ctx;
+ rg_state_t svcStatus;
+ int msgtarget = my_id();
+
+ /* Build the message header */
+ msg.sm_hdr.gh_magic = GENERIC_HDR_MAGIC;
+ msg.sm_hdr.gh_command = RG_ACTION_REQUEST;
+ msg.sm_hdr.gh_arg1 = RG_ACTION_MASTER;
+ msg.sm_hdr.gh_length = sizeof (SmMessageSt);
+
+ msg.sm_data.d_action = RG_CONVALESCE;
+
+ strncpy(msg.sm_data.d_svcName, svcName,
+ sizeof(msg.sm_data.d_svcName));
+ msg.sm_data.d_ret = 0;
+ msg.sm_data.d_svcOwner = 0;
+
+ /* Open a connection to the local node - it will decide what to
+ do in this case. XXX inefficient; should queue requests
+ locally and immediately forward requests otherwise */
+
+ if (get_service_state_internal(svcName, &svcStatus) < 0)
+ return RG_EFAIL;
+ if (svcStatus.rs_owner > 0) {
+ if (member_online(svcStatus.rs_owner)) {
+ msgtarget = svcStatus.rs_owner;
+ } else {
+ /* If the owner is not online,
+ mark the service as 'stopped' but
+ otherwise, do nothing.
+ */
+ return svc_stop(svcName, RG_STOP);
+ }
+ }
+
+ if (msg_open(MSG_CLUSTER, msgtarget, RG_PORT, &ctx, 2 * cluster_timeout)< 0) {
+ logt_print(LOG_ERR,
+ "#58: Failed opening connection to member #%d\n",
+ my_id());
+ return -1;
+ }
+
+ /* Encode */
+ swab_SmMessageSt(&msg);
+
+ /* Send stop message to the other node */
+ if (msg_send(&ctx, &msg, sizeof (SmMessageSt)) <
+ (int)sizeof (SmMessageSt)) {
+ logt_print(LOG_ERR, "Failed to send complete message\n");
+ msg_close(&ctx);
+ return -1;
+ }
+
+ /* Check the response */
+ do {
+ msg_ret = msg_receive(&ctx, &msg,
+ sizeof (SmMessageSt), 10);
+ if ((msg_ret == -1 && errno != ETIMEDOUT) ||
+ (msg_ret > 0)) {
+ break;
+ }
+ } while(1);
+
+ if (msg_ret != sizeof (SmMessageSt)) {
+ logt_print(LOG_WARNING, "Strange response size: %d vs %d\n",
+ msg_ret, (int)sizeof(SmMessageSt));
+ return 0; /* XXX really UNKNOWN */
+ }
+
+ /* Got a valid response from other node. */
+ msg_close(&ctx);
+
+ /* Decode */
+ swab_SmMessageSt(&msg);
+
+ return msg.sm_data.d_ret;
+}
+
+
/*
service_op_migrate() - send a virtual machine to another host
in the cluster
diff --git a/rgmanager/src/daemons/slang_event.c b/rgmanager/src/daemons/slang_event.c
index 55f0341..0b9f0d0 100644
--- a/rgmanager/src/daemons/slang_event.c
+++ b/rgmanager/src/daemons/slang_event.c
@@ -86,7 +86,8 @@ static int
_user_restart = RG_RESTART,
_user_migrate = RG_MIGRATE,
_user_freeze = RG_FREEZE,
- _user_unfreeze = RG_UNFREEZE;
+ _user_unfreeze = RG_UNFREEZE,
+ _user_convalesce = RG_CONVALESCE;
SLang_Intrin_Var_Type rgmanager_vars[] =
@@ -139,6 +140,7 @@ SLang_Intrin_Var_Type rgmanager_vars[] =
MAKE_VARIABLE((char *)"USER_MIGRATE", &_user_migrate, SLANG_INT_TYPE, 1),
MAKE_VARIABLE((char *)"USER_FREEZE", &_user_freeze, SLANG_INT_TYPE, 1),
MAKE_VARIABLE((char *)"USER_UNFREEZE", &_user_unfreeze,SLANG_INT_TYPE, 1),
+ MAKE_VARIABLE((char *)"USER_CONVALESCE",&_user_convalesce,SLANG_INT_TYPE, 1),
/* Errors */
MAKE_VARIABLE((char *)"rg_error", &_rg_err, SLANG_INT_TYPE, 1),
@@ -444,6 +446,18 @@ sl_service_property(char *svcName, char *prop)
/**
usage:
+ service_convalesce(name);
+ */
+static int
+sl_convalesce_service(const char *svcname)
+{
+ return service_op_convalesce(svcname);
+}
+
+
+/**
+ usage:
+
stop_service(name, disable_flag);
*/
static int
@@ -1034,6 +1048,8 @@ static SLang_Intrin_Fun_Type rgmanager_slang[] =
SLANG_VOID_TYPE),
MAKE_INTRINSIC_0((char *)"service_stop", sl_stop_service,
SLANG_INT_TYPE),
+ MAKE_INTRINSIC_S((char *)"service_convalesce", sl_convalesce_service,
+ SLANG_INT_TYPE),
MAKE_INTRINSIC_0((char *)"service_start", sl_start_service,
SLANG_INT_TYPE),
MAKE_INTRINSIC_0((char *)"service_migrate", sl_migrate_service,
diff --git a/rgmanager/src/resources/default_event_script.sl b/rgmanager/src/resources/default_event_script.sl
index fad22ac..4eae767 100644
--- a/rgmanager/src/resources/default_event_script.sl
+++ b/rgmanager/src/resources/default_event_script.sl
@@ -597,6 +597,10 @@ define default_user_event_handler()
ret = service_migrate(service_name, user_target);
+ } else if (user_request == USER_CONVALESCE) {
+
+ ret = service_convalesce(service_name);
+
}
return ret;
13 years, 7 months
cluster: STABLE3 - rgmanager: Do not fail service if non-critical resources fail to stop
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 7097cb971d5aa2d7bee6f2ac5bfd7e2db53c8f2d
Parent: d76d0935b4f130a93bf2b50f95b4a54a9264b4ab
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Sep 8 16:20:19 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Sep 24 18:17:22 2010 -0400
rgmanager: Do not fail service if non-critical resources fail to stop
During non-critical component recovery (e.g. stop and leave dead),
rgmanager stops parts up to the __independent_subtree="2" flag.
If any stop operations fail during this phase, rgmanager should
ignore them since the resources are non-critical.
During a normal relocation/restart/enable/disable/etc, these
operations are critical and a fail to stop will result in the
service being placed in to the failed state.
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/restree.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index ab0e20d..8719791 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -1510,6 +1510,21 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
node->rn_flags &= ~RF_NEEDSTOP;
rv |= res_exec(node, op, NULL, 0);
+ if (node->rn_flags & RF_QUIESCE) {
+ /* Non-critical resources = do not fail
+ * service if the resource fails to stop
+ */
+ if (rv & SFL_FAILURE) {
+ logt_print(LOG_WARNING, "Failure to stop %s:%s"
+ " during non-critical recovery "
+ "operation\n",
+ node->rn_resource->r_rule->rr_type,
+ primary_attr_value(
+ node->rn_resource));
+ rv &= ~SFL_FAILURE;
+ }
+ }
+
if (rv == 0 && (node->rn_state == RES_STARTED ||
node->rn_state == RES_FAILED)) {
assert(node->rn_resource->r_incarnations >= 0);
13 years, 7 months
cluster: STABLE3 - rgmanager: Fix handling of independent subtrees
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: d76d0935b4f130a93bf2b50f95b4a54a9264b4ab
Parent: ff4e99904248fa775a14e4cc9a2fd51cfba9085b
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Sep 8 15:56:28 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Sep 24 18:17:22 2010 -0400
rgmanager: Fix handling of independent subtrees
Independent subtrees were not getting handled
correctly in all cases. This prevented correct
recovery (e.g. stop) of resources which failed
when an ancestor was an independent subtree.
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/restree.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index e7866e2..ab0e20d 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -1149,8 +1149,8 @@ mark_nodes(resource_node_t *node, int state, int setflags, int clearflags)
resource_node_t *child;
list_for(&node->rn_child, child, x) {
- if (child->rn_child)
- mark_nodes(child->rn_child, state, setflags,
+ if (child)
+ mark_nodes(child, state, setflags,
clearflags);
}
@@ -1375,7 +1375,7 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
printf("Node %s:%s - Convalesce\n",
node->rn_resource->r_rule->rr_type,
primary_attr_value(node->rn_resource));
- node->rn_state = RES_STOPPED;
+ mark_nodes(node, RES_STOPPED, RF_NEEDSTART, 0);
op = RS_START;
}
@@ -1470,8 +1470,10 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
return SFL_FAILURE;
}
- if (node->rn_state != RES_DISABLED)
- mark_nodes(node, RES_STARTED, 0, RF_NEEDSTOP);
+ if (node->rn_state != RES_DISABLED) {
+ node->rn_state = RES_STARTED;
+ node->rn_flags &= ~RF_NEEDSTOP;
+ }
}
if (node->rn_child) {
@@ -1483,7 +1485,7 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
and all our children as failed and return a flag stating
that this section is recoverable apart from siblings in
the resource tree. */
- if (op == RS_STATUS && (rv & SFL_FAILURE) &&
+ if (op == RS_STATUS && (rv & (SFL_FAILURE|SFL_RECOVERABLE)) &&
(node->rn_flags & RF_INDEPENDENT)) {
rv = SFL_RECOVERABLE;
if (node->rn_flags & RF_NON_CRITICAL) {
@@ -1520,8 +1522,7 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
}
pthread_mutex_unlock(&node->rn_resource->r_mutex);
- if (node->rn_flags & RF_QUIESCE &&
- node->rn_flags & RF_NON_CRITICAL) {
+ if (node->rn_flags & RF_QUIESCE) {
node->rn_flags &= ~RF_QUIESCE;
node->rn_state = RES_DISABLED;
} else {
13 years, 7 months
cluster: STABLE3 - rgmanager: Ensure state is preserved across config changes
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: ff4e99904248fa775a14e4cc9a2fd51cfba9085b
Parent: 51f2f313d5f2424d58bbaa7d17315d27b39dcf75
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Sep 8 15:22:49 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Sep 24 18:17:21 2010 -0400
rgmanager: Ensure state is preserved across config changes
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/restree.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index a5f27b8..e7866e2 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -1796,6 +1796,9 @@ resource_tree_delta(resource_node_t **ltree, resource_node_t **rtree)
if (rc == 2)
rn->rn_flags |= RF_NEEDSTART | RF_RECONFIG;
+ if (rc == 0)
+ rn->rn_state = ln->rn_state;
+
/* Ok, same resource. Recurse. */
ln->rn_flags |= RF_COMMON;
rn->rn_flags |= RF_COMMON;
13 years, 7 months