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

[Cluster-devel] Cluster Project branch, RHEL5, updated. cmirror_1_1_15-62-g4d3d73c



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=4d3d73c3d60e4cce5f92bb71ec9a16d8aef4c055

The branch, RHEL5 has been updated
       via  4d3d73c3d60e4cce5f92bb71ec9a16d8aef4c055 (commit)
      from  8c73b983408ca5d1949b849e3912fc8a5b92760d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4d3d73c3d60e4cce5f92bb71ec9a16d8aef4c055
Author: Jonathan Brassow <jbrassow redhat com>
Date:   Wed May 7 14:24:19 2008 -0500

    clogd:  Comment fixes and clarifications
    
    Add UUID to message output to allow better tracking
    of errors to specific log instances.

-----------------------------------------------------------------------

Summary of changes:
 cmirror-kernel/src/dm-clog-tfr.c |   15 +++++++++------
 cmirror/src/cluster.c            |   12 +++++++++++-
 cmirror/src/functions.c          |   24 ++++++++++++------------
 cmirror/src/local.c              |    4 ++--
 4 files changed, 34 insertions(+), 21 deletions(-)

diff --git a/cmirror-kernel/src/dm-clog-tfr.c b/cmirror-kernel/src/dm-clog-tfr.c
index 6056c19..6126691 100644
--- a/cmirror-kernel/src/dm-clog-tfr.c
+++ b/cmirror-kernel/src/dm-clog-tfr.c
@@ -14,6 +14,8 @@
 
 #include <asm/div64.h> /* Unnecessary */
 
+#define SHORT_UUID(x) (strlen(x) > 8) ? ((x) + (strlen(x) - 8)) : (x)
+
 static uint64_t seq = 0;
 
 /*
@@ -186,8 +188,8 @@ resend:
 
 	r = wait_for_completion_timeout(&(pkg.complete), 15 * HZ);
 	if (!r) {
-		DMWARN("Request timed out on %s:%llu - retrying",
-		       RQ_TYPE(request_type), pkg.seq);
+		DMWARN("[%s] Request timed out: [%s/%llu] - retrying",
+		       SHORT_UUID(uuid), RQ_TYPE(request_type), pkg.seq);
 		spin_lock(&receiving_list_lock);
 		list_del_init(&(pkg.list));
 		spin_unlock(&receiving_list_lock);
@@ -198,13 +200,14 @@ resend:
 		pkg.start_time = (jiffies - pkg.start_time);
 		do_div(pkg.start_time, HZ);
 		if (pkg.start_time > 0)
-			DMWARN("Excessive delay in request processing, %llu sec for %s",
-			       pkg.start_time, RQ_TYPE(request_type));
+			DMWARN("Excessive delay in request processing, %llu sec: [%s/%llu]",
+			       pkg.start_time, RQ_TYPE(request_type),
+			       pkg.seq);
 	}
 	r = pkg.error;
 	if (r)
-		DMERR("Server error while processing request [%s]: %d",
-		      RQ_TYPE(request_type), r);
+		DMERR("[%s] Server error while processing request [%s]: %d",
+		      SHORT_UUID(uuid), RQ_TYPE(request_type), r);
 
 out:
 	spin_lock(&receiving_list_lock);
diff --git a/cmirror/src/cluster.c b/cmirror/src/cluster.c
index 504ee58..d1ab920 100644
--- a/cmirror/src/cluster.c
+++ b/cmirror/src/cluster.c
@@ -58,6 +58,7 @@ struct clog_cpg {
 
 	/* Are we the first, or have we received checkpoint? */
 	int state;
+	int cpg_state;  /* FIXME: debugging */
 	int free_me;
 	struct queue *startup_queue;
 
@@ -96,13 +97,20 @@ static int cluster_send(struct clog_tfr *tfr)
 	iov.iov_base = tfr;
 	iov.iov_len = sizeof(struct clog_tfr) + tfr->data_size;
 
+	if (entry->cpg_state != VALID)
+		LOG_ERROR("[%s] Attempt to send request to cluster while CPG not valid: "
+			  "request = %s", SHORT_UUID(tfr->uuid), RQ_TYPE(tfr->request_type));
+
 	r = cpg_mcast_joined(entry->handle, CPG_TYPE_AGREED, &iov, 1);
 	if (r == CPG_OK)
 		return 0;
 	if (r == SA_AIS_ERR_TRY_AGAIN)
 		return -EAGAIN;
 
-	LOG_ERROR("cpg_mcast_joined error: %d", r);
+	/* error codes found in openais/cpg.h */
+	LOG_ERROR("cpg_mcast_joined error: %d%s", r,
+		  (r == CPG_ERR_BAD_HANDLE) ? "/CPG_ERR_BAD_HANDLE" :
+		  (r == CPG_ERR_ACCESS) ? "/CPG_ERR_ACCESS" : "");
 
 	tfr->error = -EBADE;
 	return -EBADE;
@@ -1157,6 +1165,7 @@ int create_cluster_cpg(char *str)
 		return -EPERM;
 	}
 
+	new->cpg_state = VALID;
 	list_add(&new->list, &clog_cpg_list);
 	LOG_DBG("New   handle: %llu", (unsigned long long)new->handle);
 	LOG_DBG("New   name: %s", new->name.value);
@@ -1175,6 +1184,7 @@ int destroy_cluster_cpg(char *str)
 
 	list_for_each_entry_safe(del, tmp, &clog_cpg_list, list)
 		if (!strncmp(del->name.value, str, CPG_MAX_NAME_LENGTH)) {
+			del->cpg_state = INVALID;
 			r = cpg_leave(del->handle, &del->name);
 			if (r != CPG_OK)
 				LOG_ERROR("Error leaving CPG!");
diff --git a/cmirror/src/functions.c b/cmirror/src/functions.c
index 2c917d2..822ec17 100644
--- a/cmirror/src/functions.c
+++ b/cmirror/src/functions.c
@@ -187,16 +187,16 @@ static int rw_log(struct log_c *lc, int do_write)
 
 	r = lseek(lc->disk_fd, 0, SEEK_SET);
 	if (r < 0) {
-		LOG_ERROR("rw_log:  lseek failure: %s",
-			  strerror(errno));
+		LOG_ERROR("[%s] rw_log:  lseek failure: %s",
+			  SHORT_UUID(lc->uuid), strerror(errno));
 		return -errno;
 	}
 
 	if (do_write) {
 		r = write(lc->disk_fd, lc->disk_buffer, lc->disk_size);
 		if (r < 0) {
-			LOG_ERROR("rw_log:  write failure: %s",
-				  strerror(errno));
+			LOG_ERROR("[%s] rw_log:  write failure: %s",
+				  SHORT_UUID(lc->uuid), strerror(errno));
 			return -EIO; /* Failed disk write */
 		}
 		return 0;
@@ -205,8 +205,8 @@ static int rw_log(struct log_c *lc, int do_write)
 	/* Read */
 	r = read(lc->disk_fd, lc->disk_buffer, lc->disk_size);
 	if (r < 0)
-		LOG_ERROR("rw_log:  read failure: %s",
-			  strerror(errno));
+		LOG_ERROR("[%s] rw_log:  read failure: %s",
+			  SHORT_UUID(lc->uuid), strerror(errno));
 	if (r != lc->disk_size)
 		return -EIO; /* Failed disk read */
 	return 0;
@@ -929,16 +929,16 @@ static int clog_flush(struct clog_tfr *tfr, int server)
 	 */
 	if (server && (lc->disk_fd >= 0)) {
 		r = tfr->error = write_log(lc);
-		if (r) {
-			LOG_ERROR("Error writing to disk log");
-			return r;
-		}
-		LOG_DBG("[%s] Disk log written", SHORT_UUID(lc->uuid));
+		if (r)
+			LOG_ERROR("[%s] Error writing to disk log",
+				  SHORT_UUID(lc->uuid));
+		else 
+			LOG_DBG("[%s] Disk log written", SHORT_UUID(lc->uuid));
 	}
 
 	lc->touched = 0;
 
-	return 0;
+	return r;
 
 }
 
diff --git a/cmirror/src/local.c b/cmirror/src/local.c
index b6aa0af..da69b9f 100644
--- a/cmirror/src/local.c
+++ b/cmirror/src/local.c
@@ -160,8 +160,8 @@ static int do_local_work(void *data)
 	if (!tfr)
 		return -EBADE;
 
-	LOG_DBG("Request from kernel received [%s/%s/%llu]",
-		RQ_TYPE(tfr->request_type), SHORT_UUID(tfr->uuid),
+	LOG_DBG("[%s]  Request from kernel received: [%s/%llu]",
+		SHORT_UUID(tfr->uuid), RQ_TYPE(tfr->request_type),
 		(unsigned long long)tfr->seq);
 	switch (tfr->request_type) {
 	case 0:


hooks/post-receive
--
Cluster Project


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