diff options
author | Alex Elder <elder@inktank.com> | 2013-03-25 19:16:11 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:17:21 -0400 |
commit | 7e2766a1135544a2972d2767f3a41afd5f55067f (patch) | |
tree | 9b3eefd2fcbada1ad44cb4b9ab97a8d5cc32662d | |
parent | ad885927dee2e72fbfab624c7599cb9d9352cc04 (diff) |
libceph: send queued requests when starting new one
An osd expects the transaction ids of arriving request messages from
a given client to a given osd 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 can violate 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>
Reviewed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | net/ceph/osd_client.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 356f7bc4ae4b..3b6657fe99b1 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -1819,7 +1819,7 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc, | |||
1819 | dout("send_request %p no up osds in pg\n", req); | 1819 | dout("send_request %p no up osds in pg\n", req); |
1820 | ceph_monc_request_next_osdmap(&osdc->client->monc); | 1820 | ceph_monc_request_next_osdmap(&osdc->client->monc); |
1821 | } else { | 1821 | } else { |
1822 | __send_request(osdc, req); | 1822 | __send_queued(osdc); |
1823 | } | 1823 | } |
1824 | rc = 0; | 1824 | rc = 0; |
1825 | out_unlock: | 1825 | out_unlock: |