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

[Cluster-devel] cluster/cmirror-kernel/src dm-clog-tfr.c dm-clog.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	jbrassow sourceware org	2008-02-08 14:21:05

Modified files:
	cmirror-kernel/src: dm-clog-tfr.c dm-clog.c 

Log message:
	- table an event so userspace can respond when a log device failure
	occurs
	- other clean-ups

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-clog-tfr.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.4&r2=1.1.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-clog.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.8&r2=1.2.2.9

--- cluster/cmirror-kernel/src/dm-clog-tfr.c	2008/01/14 22:46:58	1.1.2.4
+++ cluster/cmirror-kernel/src/dm-clog-tfr.c	2008/02/08 14:21:04	1.1.2.5
@@ -72,6 +72,7 @@
 
 static void cn_clog_callback(void *data)
 {
+	int found = 0;
 	struct cn_msg *msg = (struct cn_msg *)data;
 	struct clog_tfr *tfr = (struct clog_tfr *)(msg + 1);
 	struct recieving_pkg *pkg;
@@ -100,13 +101,16 @@
 				memcpy(pkg->data, tfr->data, tfr->data_size);
 				*(pkg->data_size) = tfr->data_size;
 			}
-
+			found = 1;
 			complete(&pkg->complete);
 			break;
 		}
 	}
 
 	spin_unlock(&recieving_list_lock);
+	if (!found)
+		DMERR("Stray request returned: %s, %llu",
+		      RQ_TYPE(tfr->request_type), tfr->seq);
 }
 
 /*
@@ -123,7 +127,6 @@
  *
  * Returns: 0 on success, -EXXX on failure
  */
-static uint32_t foo[15]; /* FIXME: Pull this... Track number of sec */
 int dm_clog_consult_server(const char *uuid, int request_type,
 			   char *data, int data_size,
 			   char *rdata, int *rdata_size)
@@ -180,29 +183,22 @@
 		goto out;
 	}
 
-	r = wait_for_completion_timeout(&(pkg.complete), 5 * HZ);
+	r = wait_for_completion_timeout(&(pkg.complete), 15 * HZ);
 	if (!r) {
-		DMWARN("Timed out waiting for cluster log server [%s]",
-		       RQ_TYPE(request_type));
-		DMWARN("Retrying request [%s]", RQ_TYPE(request_type));
+		DMWARN("Request timed out on %s:%llu - retrying",
+		       RQ_TYPE(request_type), pkg.seq);
 		spin_lock(&recieving_list_lock);
 		list_del_init(&(pkg.list));
 		spin_unlock(&recieving_list_lock);
 
-		foo[10]++;
-		DMWARN("[%u][%u][%u][%u][%u][%u] [%u]",
-		       foo[0], foo[1], foo[2], foo[3], foo[4], foo[5],
-		       foo[10]);
-
 		goto resend;
 	} else { 
 		/* FIXME: Pull time checking code - it's just for profiling */
 		pkg.start_time = (jiffies - pkg.start_time);
 		do_div(pkg.start_time, HZ);
-		if ((pkg.start_time < 0) || (pkg.start_time >= 5))
-			DMWARN("OUT-OF-BOUNDS::  pkg.start_time == %llu", pkg.start_time);
-		else
-			foo[pkg.start_time]++;
+		if (pkg.start_time > 0)
+			DMWARN("Excessive delay in request processing, %llu sec for %s",
+			       pkg.start_time, RQ_TYPE(request_type));
 	}
 	r = pkg.error;
 	if (r)
--- cluster/cmirror-kernel/src/dm-clog.c	2008/01/25 16:23:24	1.2.2.8
+++ cluster/cmirror-kernel/src/dm-clog.c	2008/02/08 14:21:04	1.2.2.9
@@ -425,16 +425,8 @@
 			goto fail;
 	}
 
-	do {
-		r = cluster_do_request(lc, lc->uuid, DM_CLOG_FLUSH,
-				       NULL, 0, NULL, NULL);
-		if (r != -EAGAIN)
-			break;
-
-		DMINFO("Flush conflicts with recovery [delaying]");
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(HZ/4);
-	} while (1);
+	r = cluster_do_request(lc, lc->uuid, DM_CLOG_FLUSH,
+			       NULL, 0, NULL, NULL);
 
 fail:
 	/*
@@ -447,6 +439,9 @@
 		mempool_free(fe, flush_entry_pool);
 	}
 
+	if (r)
+		dm_table_event(lc->ti->table);
+
 	return r;
 }
 


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