]> git.baikalelectronics.ru Git - kernel.git/commit
libceph: fix osd request queuing on osdmap updates
authorSage Weil <sage@newdream.net>
Tue, 18 Jan 2011 04:34:08 +0000 (20:34 -0800)
committerSage Weil <sage@newdream.net>
Mon, 21 Mar 2011 19:24:19 +0000 (12:24 -0700)
commit39834d59b1b784142355c9657bc5d7389f64fac9
tree233e96acdc3b627c97267992368ae1cb6cd66a5f
parent23eb60794ec1105add4226c15f4c54c9f63bd3b3
libceph: fix osd request queuing on osdmap updates

If we send a request to osd A, and the request's pg remaps to osd B and
then back to A in quick succession, we need to resend the request to A. The
old code was only calling kick_requests after processing all incremental
maps in a message, so it was very possible to not resend a request that
needed to be resent.  This would make the osd eventually time out (at least
with the current default of osd timeouts enabled).

The correct approach is to scan requests on every map incremental.  This
patch refactors the kick code in a few ways:
 - all requests are either on req_lru (in flight), req_unsent (ready to
   send), or req_notarget (currently map to no up osd)
 - mapping always done by map_request (previous map_osds)
 - if the mapping changes, we requeue.  requests are resent only after all
   map incrementals are processed.
 - some osd reset code is moved out of kick_requests into a separate
   function
 - the "kick this osd" functionality is moved to kick_osd_requests, as it
   is unrelated to scanning for request->pg->osd mapping changes

Signed-off-by: Sage Weil <sage@newdream.net>
include/linux/ceph/osd_client.h
net/ceph/osd_client.c