All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH 1/2] rgmanager: Mark services on dead nodes as stopped [RHEL5]
@ 2011-10-27 23:32 Lon Hohberger
  2011-10-27 23:32 ` [Cluster-devel] [PATCH 2/2] rgmanager: Send events on service stop & preserve frozen flag [RHEL5] Lon Hohberger
  0 siblings, 1 reply; 3+ messages in thread
From: Lon Hohberger @ 2011-10-27 23:32 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Cleans up clustat reporting and avoids a race.

Resolves: rhbz#722230

Signed-off-by: Lon Hohberger <lhh@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)
-- 
1.7.3.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-28  4:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-27 23:32 [Cluster-devel] [PATCH 1/2] rgmanager: Mark services on dead nodes as stopped [RHEL5] Lon Hohberger
2011-10-27 23:32 ` [Cluster-devel] [PATCH 2/2] rgmanager: Send events on service stop & preserve frozen flag [RHEL5] Lon Hohberger
2011-10-28  4:44   ` Fabio M. Di Nitto

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.