From: Lon Hohberger <lhh@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [patch] Fix independent subtree status checking
Date: Wed, 29 Aug 2007 17:39:07 -0400 [thread overview]
Message-ID: <20070829213907.GQ17551@redhat.com> (raw)
Independent subtree recovery in rgmanager is not correct without
this patch.
--
Lon Hohberger - Software Engineer - Red Hat, Inc.
-------------- next part --------------
Index: restree.c
===================================================================
RCS file: /cvs/cluster/cluster/rgmanager/src/daemons/restree.c,v
retrieving revision 1.23.2.10
diff -u -r1.23.2.10 restree.c
--- restree.c 2 Aug 2007 14:46:51 -0000 1.23.2.10
+++ restree.c 29 Aug 2007 21:37:58 -0000
@@ -954,20 +954,17 @@
return _res_op(&node->rn_child, first, NULL, ret, op);
if (op == RS_START || op == RS_STATUS) {
- rv = _do_child_levels(tree, first, ret, op);
+ rv |= _do_child_levels(tree, first, ret, op);
if (rv & SFL_FAILURE)
return rv;
/* Start default level after specified ones */
- rv = _do_child_default_level(tree, first, ret, op);
+ rv |= _do_child_default_level(tree, first, ret, op);
} /* stop */ else {
- rv = _do_child_default_level(tree, first, ret, op);
- if (rv != 0)
- return rv;
-
- rv = _do_child_levels(tree, first, ret, op);
+ rv |= _do_child_default_level(tree, first, ret, op);
+ rv |= _do_child_levels(tree, first, ret, op);
}
return rv;
@@ -1245,22 +1242,8 @@
}
- if (node->rn_child) {
- rv = _res_op_by_level(&node, me?NULL:first, ret, op);
- if (rv != 0) {
- mark_nodes(node, RES_FAILED,
- RF_NEEDSTART | RF_NEEDSTOP);
-
- /* If this node is independent of its siblings,
- that one of its dependent children failed
- does not matter: its dependent children must
- also be independent of this node's siblings. */
- if (node->rn_flags & RF_INDEPENDENT)
- return SFL_RECOVERABLE;
-
- return SFL_FAILURE;
- }
- }
+ if (node->rn_child)
+ rv |= _res_op_by_level(&node, me?NULL:first, ret, op);
/* Stop should occur after children have stopped */
if (me && (op == RS_STOP)) {
Index: rg_state.c
===================================================================
RCS file: /cvs/cluster/cluster/rgmanager/src/daemons/rg_state.c,v
retrieving revision 1.24.2.12
diff -u -r1.24.2.12 rg_state.c
--- rg_state.c 2 Aug 2007 14:46:51 -0000 1.24.2.12
+++ rg_state.c 29 Aug 2007 21:37:58 -0000
@@ -1130,10 +1130,13 @@
static inline int
handle_started_status(char *svcName, int ret, rg_state_t *svcStatus)
{
+ int newowner;
+
if (ret & SFL_FAILURE) {
- ret = msvc_check_cluster(svcName);
- if (ret >= 0)
- return 1;
+ newowner = msvc_check_cluster(svcName);
+ if (newowner >= 0)
+ return 0; /* running but not here */
+ return ret; /* not running anymore */
}
/* Ok, we have a recoverable service. Try to perform
Index: test.c
===================================================================
RCS file: /cvs/cluster/cluster/rgmanager/src/daemons/test.c,v
retrieving revision 1.6.2.5
diff -u -r1.6.2.5 test.c
--- test.c 31 Jul 2007 17:54:54 -0000 1.6.2.5
+++ test.c 29 Aug 2007 21:37:58 -0000
@@ -238,7 +238,7 @@
ret = res_status(&tree, curres, NULL);
if (ret) {
- printf("Status check of %s failed\n", argv[3]);
+ printf("Status check of %s failed, ret=%d\n", argv[3], ret);
goto out;
}
printf("Status of %s is good\n", argv[3]);
reply other threads:[~2007-08-29 21:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070829213907.GQ17551@redhat.com \
--to=lhh@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.