cluster: RHEL55 - clogd (cmirror): Reinit ckpt handle if openAIS goes away (bz518665)

Jonathan Brassow jbrassow at fedoraproject.org
Tue Dec 22 08:23:59 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ab4161cbc2c824fc32ae46e78f2342092ccbf406
Commit:        ab4161cbc2c824fc32ae46e78f2342092ccbf406
Parent:        705a2bfb5936ccec989c4ec9d73efca286704408
Author:        Jonathan Brassow <jbrassow at redhat.com>
AuthorDate:    Tue Dec 22 02:17:38 2009 -0600
Committer:     Jonathan Brassow <jbrassow at redhat.com>
CommitterDate: Tue Dec 22 02:19:02 2009 -0600

clogd (cmirror): Reinit ckpt handle if openAIS goes away (bz518665)

It is possible to pull the rug out from under the cluster log
daemon by stopping the checkpoint service (openAIS) for which
the log daemon has a handle.

If the handle is later used, various errors are given.  It doesn't
hurt to aquire a new handle though, so that is what is done.
---
 cmirror/src/cluster.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/cmirror/src/cluster.c b/cmirror/src/cluster.c
index 1ecef33..9c84f1d 100644
--- a/cmirror/src/cluster.c
+++ b/cmirror/src/cluster.c
@@ -458,10 +458,19 @@ open_retry:
 	}
 
 	if (rv != SA_AIS_OK) {
-		LOG_ERROR("[%s] Failed to open checkpoint for %u: %s",
+		LOG_ERROR("[%s] Failed to open checkpoint for %u: %s(%d)",
 			  SHORT_UUID(cp->uuid), cp->requester,
-			  str_ais_error(rv));
-		return -EIO; /* FIXME: better error */
+			  str_ais_error(rv), rv);
+		saCkptFinalize(ckpt_handle);
+		LOG_ERROR("[%s] Reinitializing checkpoint library handle",
+			  SHORT_UUID(cp->uuid));
+		rv = saCkptInitialize(&ckpt_handle, &callbacks, &version);
+		if (rv != SA_AIS_OK) {
+			LOG_ERROR("[%s] Unable to restart checkpoint library",
+				  SHORT_UUID(cp->uuid));
+			return -EIO;
+		}
+		goto open_retry;
 	}
 
 	/*
@@ -610,7 +619,16 @@ open_retry:
 	if (rv != SA_AIS_OK) {
 		LOG_ERROR("[%s] Failed to open checkpoint: %s",
 			  SHORT_UUID(entry->name.value), str_ais_error(rv));
-		return -EIO; /* FIXME: better error */
+		saCkptFinalize(ckpt_handle);
+		LOG_ERROR("[%s] Reinitializing checkpoint library handle",
+			  SHORT_UUID(entry->name.value));
+		rv = saCkptInitialize(&ckpt_handle, &callbacks, &version);
+		if (rv != SA_AIS_OK) {
+			LOG_ERROR("[%s] Unable to restart checkpoint library",
+				  SHORT_UUID(entry->name.value));
+			return -EIO;
+		}
+		goto open_retry;
 	}
 
 unlink_retry:


More information about the cluster-commits mailing list