This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RHEL5 - clogd: Optimization - ACK 'clear region' request beforesending to cluster


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d437c7e1272941498e90d8ab939ca91b530f5d1f
Commit:        d437c7e1272941498e90d8ab939ca91b530f5d1f
Parent:        29b4608b93abf8517b735c9c7065c96f8be1c529
Author:        Jonathan Brassow <jbrassow@redhat.com>
AuthorDate:    Wed Aug 27 14:48:04 2008 -0500
Committer:     Jonathan Brassow <jbrassow@redhat.com>
CommitterDate: Wed Aug 27 14:48:04 2008 -0500

clogd:  Optimization - ACK 'clear region' request before sending to cluster

Make CLEAR_REGION requests (a often issued request) faster.
---
 cmirror/src/cluster.c |    3 ++-
 cmirror/src/local.c   |   18 +++++++++++++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/cmirror/src/cluster.c b/cmirror/src/cluster.c
index 68ffefb..be8a5b9 100644
--- a/cmirror/src/cluster.c
+++ b/cmirror/src/cluster.c
@@ -177,7 +177,8 @@ static int handle_cluster_request(struct clog_tfr *tfr, int server, int printz)
 	    (tfr->originator == my_cluster_id))
 		r = do_request(tfr, server);
 
-	if (server) {
+	if (server &&
+	    (tfr->request_type != DM_CLOG_CLEAR_REGION)) {
 		tfr->request_type |= DM_CLOG_RESPONSE;
 
 		/*
diff --git a/cmirror/src/local.c b/cmirror/src/local.c
index 0a65870..aa5b6e7 100644
--- a/cmirror/src/local.c
+++ b/cmirror/src/local.c
@@ -258,7 +258,6 @@ static int do_local_work(void *data)
 	case DM_CLOG_IS_CLEAN:
 	case DM_CLOG_FLUSH:
 	case DM_CLOG_MARK_REGION:
-	case DM_CLOG_CLEAR_REGION:
 	case DM_CLOG_GET_RESYNC_WORK:
 	case DM_CLOG_SET_REGION_SYNC:
 	case DM_CLOG_IS_REMOTE_RECOVERING:
@@ -280,6 +279,23 @@ static int do_local_work(void *data)
 		}
 
 		break;
+	case DM_CLOG_CLEAR_REGION:
+		r = kernel_ack(tfr->seq, 0);
+
+		r = cluster_send(tfr);
+		if (r) {
+			LOG_ERROR("[%s] Unable to send %s to cluster: %s",
+				  SHORT_UUID(tfr->uuid),
+				  RQ_TYPE(tfr->request_type), strerror(-r));
+			/*
+			 * FIXME: store error for delivery on flush
+			 *        This would allow us to optimize MARK_REGION
+			 *        too.
+			 */
+		}
+		queue_add_tail(tfr, free_queue);
+
+		break;
 	case DM_CLOG_GET_REGION_SIZE:
 	default:
 		LOG_ERROR("Invalid log request received, ignoring.");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]