Skip to content

Commit 83aff95

Browse files
Sage WeilAlex Elder
authored andcommitted
libceph: remove 'osdtimeout' option
This would reset a connection with any OSD that had an outstanding request that was taking more than N seconds. The idea was that if the OSD was buggy, the client could compensate by resending the request. In reality, this only served to hide server bugs, and we haven't actually seen such a bug in quite a while. Moreover, the userspace client code never did this. More importantly, often the request is taking a long time because the OSD is trying to recover, or overloaded, and killing the connection and retrying would only make the situation worse by giving the OSD more work to do. Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Alex Elder <elder@inktank.com>
1 parent cfc84c9 commit 83aff95

4 files changed

Lines changed: 5 additions & 49 deletions

File tree

‎fs/ceph/super.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,6 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)
403403
seq_printf(m, ",mount_timeout=%d", opt->mount_timeout);
404404
if (opt->osd_idle_ttl != CEPH_OSD_IDLE_TTL_DEFAULT)
405405
seq_printf(m, ",osd_idle_ttl=%d", opt->osd_idle_ttl);
406-
if (opt->osd_timeout != CEPH_OSD_TIMEOUT_DEFAULT)
407-
seq_printf(m, ",osdtimeout=%d", opt->osd_timeout);
408406
if (opt->osd_keepalive_timeout != CEPH_OSD_KEEPALIVE_DEFAULT)
409407
seq_printf(m, ",osdkeepalivetimeout=%d",
410408
opt->osd_keepalive_timeout);

‎include/linux/ceph/libceph.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ struct ceph_options {
4343
struct ceph_entity_addr my_addr;
4444
int mount_timeout;
4545
int osd_idle_ttl;
46-
int osd_timeout;
4746
int osd_keepalive_timeout;
4847

4948
/*
@@ -63,7 +62,6 @@ struct ceph_options {
6362
* defaults
6463
*/
6564
#define CEPH_MOUNT_TIMEOUT_DEFAULT 60
66-
#define CEPH_OSD_TIMEOUT_DEFAULT 60 /* seconds */
6765
#define CEPH_OSD_KEEPALIVE_DEFAULT 5
6866
#define CEPH_OSD_IDLE_TTL_DEFAULT 60
6967

‎net/ceph/ceph_common.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ ceph_parse_options(char *options, const char *dev_name,
305305

306306
/* start with defaults */
307307
opt->flags = CEPH_OPT_DEFAULT;
308-
opt->osd_timeout = CEPH_OSD_TIMEOUT_DEFAULT;
309308
opt->osd_keepalive_timeout = CEPH_OSD_KEEPALIVE_DEFAULT;
310309
opt->mount_timeout = CEPH_MOUNT_TIMEOUT_DEFAULT; /* seconds */
311310
opt->osd_idle_ttl = CEPH_OSD_IDLE_TTL_DEFAULT; /* seconds */
@@ -391,7 +390,7 @@ ceph_parse_options(char *options, const char *dev_name,
391390

392391
/* misc */
393392
case Opt_osdtimeout:
394-
opt->osd_timeout = intval;
393+
pr_warning("ignoring deprecated osdtimeout option\n");
395394
break;
396395
case Opt_osdkeepalivetimeout:
397396
opt->osd_keepalive_timeout = intval;

‎net/ceph/osd_client.c‎

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -608,14 +608,6 @@ static void __kick_osd_requests(struct ceph_osd_client *osdc,
608608
}
609609
}
610610

611-
static void kick_osd_requests(struct ceph_osd_client *osdc,
612-
struct ceph_osd *kickosd)
613-
{
614-
mutex_lock(&osdc->request_mutex);
615-
__kick_osd_requests(osdc, kickosd);
616-
mutex_unlock(&osdc->request_mutex);
617-
}
618-
619611
/*
620612
* If the osd connection drops, we need to resubmit all requests.
621613
*/
@@ -629,7 +621,9 @@ static void osd_reset(struct ceph_connection *con)
629621
dout("osd_reset osd%d\n", osd->o_osd);
630622
osdc = osd->o_osdc;
631623
down_read(&osdc->map_sem);
632-
kick_osd_requests(osdc, osd);
624+
mutex_lock(&osdc->request_mutex);
625+
__kick_osd_requests(osdc, osd);
626+
mutex_unlock(&osdc->request_mutex);
633627
send_queued(osdc);
634628
up_read(&osdc->map_sem);
635629
}
@@ -1091,12 +1085,10 @@ static void handle_timeout(struct work_struct *work)
10911085
{
10921086
struct ceph_osd_client *osdc =
10931087
container_of(work, struct ceph_osd_client, timeout_work.work);
1094-
struct ceph_osd_request *req, *last_req = NULL;
1088+
struct ceph_osd_request *req;
10951089
struct ceph_osd *osd;
1096-
unsigned long timeout = osdc->client->options->osd_timeout * HZ;
10971090
unsigned long keepalive =
10981091
osdc->client->options->osd_keepalive_timeout * HZ;
1099-
unsigned long last_stamp = 0;
11001092
struct list_head slow_osds;
11011093
dout("timeout\n");
11021094
down_read(&osdc->map_sem);
@@ -1105,37 +1097,6 @@ static void handle_timeout(struct work_struct *work)
11051097

11061098
mutex_lock(&osdc->request_mutex);
11071099

1108-
/*
1109-
* reset osds that appear to be _really_ unresponsive. this
1110-
* is a failsafe measure.. we really shouldn't be getting to
1111-
* this point if the system is working properly. the monitors
1112-
* should mark the osd as failed and we should find out about
1113-
* it from an updated osd map.
1114-
*/
1115-
while (timeout && !list_empty(&osdc->req_lru)) {
1116-
req = list_entry(osdc->req_lru.next, struct ceph_osd_request,
1117-
r_req_lru_item);
1118-
1119-
/* hasn't been long enough since we sent it? */
1120-
if (time_before(jiffies, req->r_stamp + timeout))
1121-
break;
1122-
1123-
/* hasn't been long enough since it was acked? */
1124-
if (req->r_request->ack_stamp == 0 ||
1125-
time_before(jiffies, req->r_request->ack_stamp + timeout))
1126-
break;
1127-
1128-
BUG_ON(req == last_req && req->r_stamp == last_stamp);
1129-
last_req = req;
1130-
last_stamp = req->r_stamp;
1131-
1132-
osd = req->r_osd;
1133-
BUG_ON(!osd);
1134-
pr_warning(" tid %llu timed out on osd%d, will reset osd\n",
1135-
req->r_tid, osd->o_osd);
1136-
__kick_osd_requests(osdc, osd);
1137-
}
1138-
11391100
/*
11401101
* ping osds that are a bit slow. this ensures that if there
11411102
* is a break in the TCP connection we will notice, and reopen

0 commit comments

Comments
 (0)