cluster: RHEL55 - rgmanager: Make relocate-to-offline consistent

Lon Hohberger lon at fedoraproject.org
Wed Feb 10 22:54:38 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5c6b9d216ad358e83ae6f5307f1622427c878afc
Commit:        5c6b9d216ad358e83ae6f5307f1622427c878afc
Parent:        c35975aa2c0819482e29ca6e391f5a9f15dbcea9
Author:        Lon Hohberger <lhh at redhat.com>
AuthorDate:    Wed Feb 10 14:12:40 2010 -0500
Committer:     Lon Hohberger <lhh at redhat.com>
CommitterDate: Wed Feb 10 17:36:24 2010 -0500

rgmanager: Make relocate-to-offline consistent

Relocating (note: not migrating) a service is supposed
to try other hosts if the specified target is offline.

This works correctly when central_processing is enabled,
but not in standard mode.  This patch fixes the errant
behavior.

Resolves: rhbz#536157

Signed-off-by: Lon Hohberger <lhh at redhat.com>
---
 rgmanager/src/daemons/rg_state.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/rgmanager/src/daemons/rg_state.c b/rgmanager/src/daemons/rg_state.c
index ce5189c..49464d5 100644
--- a/rgmanager/src/daemons/rg_state.c
+++ b/rgmanager/src/daemons/rg_state.c
@@ -1731,18 +1731,17 @@ handle_relocate_req(char *svcName, int orig_request, int preferred_target,
 		/* TODO: simplify this and don't keep alloc/freeing 
 		   member lists */
 		allowed_nodes = member_list();
-		/* Avoid even bothering the other node if we can */
-		m = memb_id_to_p(allowed_nodes, preferred_target);
-		if (!m) {
-			free_member_list(allowed_nodes);
-			return RG_EINVAL;
-		}
 
-		count_resource_groups_local(m);
-		if (m->cn_svcexcl ||
-	    	    (m->cn_svccount && is_exclusive(svcName))) {
-			free_member_list(allowed_nodes);
-			return RG_EDEPEND;
+		m = memb_id_to_p(allowed_nodes, preferred_target);
+		if (m && m->cn_member) {
+			count_resource_groups_local(m);
+			if (m->cn_svcexcl ||
+			    (m->cn_svccount && is_exclusive(svcName))) {
+				free_member_list(allowed_nodes);
+				return RG_EDEPEND;
+			}
+		} else {
+			target = preferred_target = -1;
 		}
 		free_member_list(allowed_nodes);
 	}


More information about the cluster-commits mailing list