public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Brassow <jbrassow@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: RHEL5 - clogd: Optimization - ACK 'clear region' request before sending to cluster
Date: Thu, 28 Aug 2008 07:34:00 -0000	[thread overview]
Message-ID: <20080827194837.AA3B812036B@lists.fedorahosted.org> (raw)

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.");


                 reply	other threads:[~2008-08-27 19:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080827194837.AA3B812036B@lists.fedorahosted.org \
    --to=jbrassow@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).