[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/rgmanager ChangeLog include/resgroup.h ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	lhh sourceware org	2007-12-14 19:37:00

Modified files:
	rgmanager      : ChangeLog 
	rgmanager/include: resgroup.h 
	rgmanager/src/daemons: rg_state.c service_op.c 

Log message:
	Add return value for inability to run due to exclusive flag being present

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/ChangeLog.diff?cvsroot=cluster&r1=1.64&r2=1.65
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/include/resgroup.h.diff?cvsroot=cluster&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/rg_state.c.diff?cvsroot=cluster&r1=1.42&r2=1.43
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/service_op.c.diff?cvsroot=cluster&r1=1.1&r2=1.2

--- cluster/rgmanager/ChangeLog	2007/12/12 21:41:32	1.64
+++ cluster/rgmanager/ChangeLog	2007/12/14 19:37:00	1.65
@@ -1,3 +1,7 @@
+2007-12-14 Lon Hohberger <lhh at redhat.com>
+	* Add return code for inability to run because of exclusive 
+	tag
+
 2007-12-12 Lon Hohberger <lhh at redhat.com>
 	* Misc changes; add missing ds.h
 	* src/resources/default*.sl: Make clusvcadm -r go to a different
--- cluster/rgmanager/include/resgroup.h	2007/11/30 21:36:28	1.25
+++ cluster/rgmanager/include/resgroup.h	2007/12/14 19:37:00	1.26
@@ -202,6 +202,8 @@
 int my_id(void);
 
 /* Return codes */
+#define RG_EEXCL	-16		/* Service not runnable due to
+					   inability to start exclusively */
 #define RG_EDOMAIN	-15		/* Service not runnable given the
 					   set of nodes and its failover
 					   domain */
--- cluster/rgmanager/src/daemons/rg_state.c	2007/11/30 21:36:28	1.42
+++ cluster/rgmanager/src/daemons/rg_state.c	2007/12/14 19:37:00	1.43
@@ -2067,7 +2067,7 @@
 		if (check_exclusive_resources(membership, svcName) != 0) {
 			free_member_list(membership);
 			pthread_mutex_unlock(&exclusive_mutex);
-			return RG_EFAIL;
+			return RG_EEXCL;
 		}
 	}
 	free_member_list(membership);
--- cluster/rgmanager/src/daemons/service_op.c	2007/11/30 21:36:28	1.1
+++ cluster/rgmanager/src/daemons/service_op.c	2007/12/14 19:37:00	1.2
@@ -51,6 +51,7 @@
 {
 	int target;
 	int ret, x;
+	int excl = 0, dep = 0, fail = 0;
 	rg_state_t svcStatus;
 	
 	if (get_service_state_internal(svcName, &svcStatus) < 0) {
@@ -74,8 +75,14 @@
 			if (new_owner)
 				*new_owner = svcStatus.rs_owner;
 			return 0;
+		case RG_EEXCL:
+			++excl;
+			continue;
 		case RG_EDEPEND:
+			++dep;
+			continue;
 		case RG_EFAIL:
+			++fail;
 			continue;
 		case RG_EABORT:
 			svc_report_failure(svcName);
@@ -100,7 +107,15 @@
 		}
 	}
 
-	return RG_EFAIL;
+	ret = RG_EFAIL;
+	if (excl == target_list_len) 
+		ret = RG_EEXCL;
+	else if (dep == target_list_len)
+		ret = RG_EDEPEND;
+
+	clulog(LOG_INFO, "Start failed; node reports: %d failures, "
+	       "%d exclusive, %d dependency errors\n", fail, excl, dep);
+	return ret;
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]