cluster: RHEL58 - rgmanager: Mark services on dead nodes as stopped

Lon Hohberger lon at fedoraproject.org
Fri Oct 28 13:08:52 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=7774de6ec56c9180eca121429207d0e82857bde5
Commit:        7774de6ec56c9180eca121429207d0e82857bde5
Parent:        e730f686906f480e9925621d31404c2b210abee6
Author:        Lon Hohberger <lhh at redhat.com>
AuthorDate:    Thu Aug 11 10:39:04 2011 -0400
Committer:     Lon Hohberger <lhh at redhat.com>
CommitterDate: Fri Oct 28 09:04:20 2011 -0400

rgmanager: Mark services on dead nodes as stopped

Cleans up clustat reporting and avoids a race.

Resolves: rhbz#722230

Signed-off-by: Lon Hohberger <lhh at redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
 rgmanager/src/daemons/groups.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/rgmanager/src/daemons/groups.c b/rgmanager/src/daemons/groups.c
index 1e93e03..77f0d05 100644
--- a/rgmanager/src/daemons/groups.c
+++ b/rgmanager/src/daemons/groups.c
@@ -741,6 +741,32 @@ eval_groups(int local, uint32_t nodeid, int nodeStatus)
 			continue;
 		}
 
+		/* Mark the service as stopped if applicable */
+		if ((svcStatus.rs_owner == nodeid && !nodeStatus) &&
+		    (svcStatus.rs_state == RG_STATE_STARTED ||
+		     svcStatus.rs_state == RG_STATE_RECOVER ||
+		     svcStatus.rs_state == RG_STATE_STARTING ||
+		     svcStatus.rs_state == RG_STATE_STOPPING )) {
+
+			clulog(LOG_DEBUG,
+			       "Marking %s on down member %d as stopped",
+			       svcName, nodeid);
+
+			svcStatus.rs_last_owner = svcStatus.rs_owner;
+			svcStatus.rs_state = RG_STATE_STOPPED;
+			svcStatus.rs_owner = 0;
+			svcStatus.rs_transition = (uint64_t)time(NULL);
+			svcStatus.rs_flags = 0;
+
+			if (set_rg_state(svcName, &svcStatus) != 0) {
+				clulog(LOG_ERR, "Failed to update state"
+				       " of %s during recovery; cannot "
+				       "fail over", svcName);
+				rg_unlock(&lockp);
+				continue;
+			}
+		}
+
 		rg_unlock(&lockp);
 
 		if (svcStatus.rs_owner == 0)


More information about the cluster-commits mailing list