All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@inktank.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH 5/6] libceph: send queued requests when starting new one
Date: Mon, 25 Mar 2013 21:28:08 -0500	[thread overview]
Message-ID: <515107B8.2070401@inktank.com> (raw)
In-Reply-To: <5151071C.3000309@inktank.com>

An osd expects the transaction ids of arriving request messages from
a given client to increase monotonically.  So the osd client needs
to send its requests in ascending tid order.

The transaction id for a request is set at the time it is
registered, in __register_request().  This is also where the request
gets placed at the end of the osd client's unsent messages list.

At the end of ceph_osdc_start_request(), the request message for a
newly-mapped osd request is supplied to the messenger to be sent
(via __send_request()).  If any other messages were present in the
osd client's unsent list at that point they would be sent *after*
this new request message.

Because those unsent messages have already been registered, their
tids would be lower than the newly-mapped request message, and
sending that message first violates the tid ordering rule.

Rather than sending the new request only, send all queued requests
(including the new one) at that point in ceph_osdc_start_request().
This ensures the tid ordering property is preserved.

With this in place, all messages should now be sent in tid order
regardless of whether they're being sent for the first time or
re-sent as a result of a call to osd_reset().

This resolves:
    http://tracker.ceph.com/issues/4392

Signed-off-by: Alex Elder <elder@inktank.com>
---
 net/ceph/osd_client.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 202b9cd..4d98424 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1806,7 +1806,7 @@ int ceph_osdc_start_request(struct ceph_osd_client
*osdc,
 		dout("send_request %p no up osds in pg\n", req);
 		ceph_monc_request_next_osdmap(&osdc->client->monc);
 	} else {
-		__send_request(osdc, req);
+		__send_queued(osdc);
 	}
 	rc = 0;
 out_unlock:
-- 
1.7.9.5


  parent reply	other threads:[~2013-03-26  2:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26  2:25 [PATCH 0/6] libceph: send osd requests in tid order Alex Elder
2013-03-26  2:27 ` [PATCH 1/6] libceph: slightly defer registering osd request Alex Elder
2013-03-26  2:27 ` [PATCH 2/6] libceph: no more kick_requests() race Alex Elder
2013-03-26  2:27 ` [PATCH 3/6] libceph: prepend requests in order when kicking Alex Elder
2013-03-26 14:50   ` [PATCH 3/6, v2] libceph: requeue only sent requests " Alex Elder
2013-03-26  2:27 ` [PATCH 4/6] libceph: keep request lists in tid order Alex Elder
2013-03-26  2:28 ` Alex Elder [this message]
2013-03-26  2:28 ` [PATCH 6/6] libceph: verify requests queued in order Alex Elder
2013-03-26 14:50   ` [PATCH 6/6, v2] " Alex Elder
2013-03-26 14:49 ` [PATCH 0/6] libceph: send osd requests in tid order Alex Elder

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=515107B8.2070401@inktank.com \
    --to=elder@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.