aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-01-17 23:34:08 -0500
committerSage Weil <sage@newdream.net>2011-03-21 15:24:19 -0400
commit6f6c7006755b667f9f6c1f3b6f08cd65f75cc471 (patch)
tree233e96acdc3b627c97267992368ae1cb6cd66a5f /include/linux
parent09adc80c611bb8902daa8ccfe34dbbc009d6befe (diff)
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>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ceph/osd_client.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index a1af29648fb5..e791b8e46353 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -74,7 +74,6 @@ struct ceph_osd_request {
74 char r_oid[40]; /* object name */ 74 char r_oid[40]; /* object name */
75 int r_oid_len; 75 int r_oid_len;
76 unsigned long r_stamp; /* send OR check time */ 76 unsigned long r_stamp; /* send OR check time */
77 bool r_resend; /* msg send failed, needs retry */
78 77
79 struct ceph_file_layout r_file_layout; 78 struct ceph_file_layout r_file_layout;
80 struct ceph_snap_context *r_snapc; /* snap context for writes */ 79 struct ceph_snap_context *r_snapc; /* snap context for writes */
@@ -104,7 +103,9 @@ struct ceph_osd_client {
104 u64 timeout_tid; /* tid of timeout triggering rq */ 103 u64 timeout_tid; /* tid of timeout triggering rq */
105 u64 last_tid; /* tid of last request */ 104 u64 last_tid; /* tid of last request */
106 struct rb_root requests; /* pending requests */ 105 struct rb_root requests; /* pending requests */
107 struct list_head req_lru; /* pending requests lru */ 106 struct list_head req_lru; /* in-flight lru */
107 struct list_head req_unsent; /* unsent/need-resend queue */
108 struct list_head req_notarget; /* map to no osd */
108 int num_requests; 109 int num_requests;
109 struct delayed_work timeout_work; 110 struct delayed_work timeout_work;
110 struct delayed_work osds_timeout_work; 111 struct delayed_work osds_timeout_work;