Commit 58d81b12 authored by Ilya Dryomov's avatar Ilya Dryomov

libceph: monc ping rate is 10s

Split ping interval and ping timeout: ping interval is 10s; keepalive
timeout is 30s.

Make monc_ping_timeout a constant while at it - it's not actually
exported as a mount option (and the rest of tick-related settings won't
be either), so it's got no place in ceph_options.
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 0e04dc26
...@@ -47,7 +47,6 @@ struct ceph_options { ...@@ -47,7 +47,6 @@ struct ceph_options {
unsigned long mount_timeout; /* jiffies */ unsigned long mount_timeout; /* jiffies */
unsigned long osd_idle_ttl; /* jiffies */ unsigned long osd_idle_ttl; /* jiffies */
unsigned long osd_keepalive_timeout; /* jiffies */ unsigned long osd_keepalive_timeout; /* jiffies */
unsigned long monc_ping_timeout; /* jiffies */
/* /*
* any type that can't be simply compared or doesn't need need * any type that can't be simply compared or doesn't need need
...@@ -68,7 +67,9 @@ struct ceph_options { ...@@ -68,7 +67,9 @@ struct ceph_options {
#define CEPH_MOUNT_TIMEOUT_DEFAULT msecs_to_jiffies(60 * 1000) #define CEPH_MOUNT_TIMEOUT_DEFAULT msecs_to_jiffies(60 * 1000)
#define CEPH_OSD_KEEPALIVE_DEFAULT msecs_to_jiffies(5 * 1000) #define CEPH_OSD_KEEPALIVE_DEFAULT msecs_to_jiffies(5 * 1000)
#define CEPH_OSD_IDLE_TTL_DEFAULT msecs_to_jiffies(60 * 1000) #define CEPH_OSD_IDLE_TTL_DEFAULT msecs_to_jiffies(60 * 1000)
#define CEPH_MONC_PING_TIMEOUT_DEFAULT msecs_to_jiffies(30 * 1000)
#define CEPH_MONC_PING_INTERVAL msecs_to_jiffies(10 * 1000)
#define CEPH_MONC_PING_TIMEOUT msecs_to_jiffies(30 * 1000)
#define CEPH_MSG_MAX_FRONT_LEN (16*1024*1024) #define CEPH_MSG_MAX_FRONT_LEN (16*1024*1024)
#define CEPH_MSG_MAX_MIDDLE_LEN (16*1024*1024) #define CEPH_MSG_MAX_MIDDLE_LEN (16*1024*1024)
......
...@@ -361,7 +361,6 @@ ceph_parse_options(char *options, const char *dev_name, ...@@ -361,7 +361,6 @@ ceph_parse_options(char *options, const char *dev_name,
opt->osd_keepalive_timeout = CEPH_OSD_KEEPALIVE_DEFAULT; opt->osd_keepalive_timeout = CEPH_OSD_KEEPALIVE_DEFAULT;
opt->mount_timeout = CEPH_MOUNT_TIMEOUT_DEFAULT; opt->mount_timeout = CEPH_MOUNT_TIMEOUT_DEFAULT;
opt->osd_idle_ttl = CEPH_OSD_IDLE_TTL_DEFAULT; opt->osd_idle_ttl = CEPH_OSD_IDLE_TTL_DEFAULT;
opt->monc_ping_timeout = CEPH_MONC_PING_TIMEOUT_DEFAULT;
/* get mon ip(s) */ /* get mon ip(s) */
/* ip1[:port1][,ip2[:port2]...] */ /* ip1[:port1][,ip2[:port2]...] */
......
...@@ -202,15 +202,12 @@ static bool __sub_expired(struct ceph_mon_client *monc) ...@@ -202,15 +202,12 @@ static bool __sub_expired(struct ceph_mon_client *monc)
*/ */
static void __schedule_delayed(struct ceph_mon_client *monc) static void __schedule_delayed(struct ceph_mon_client *monc)
{ {
struct ceph_options *opt = monc->client->options;
unsigned long delay; unsigned long delay;
if (monc->cur_mon < 0 || __sub_expired(monc)) { if (monc->cur_mon < 0 || __sub_expired(monc)) {
delay = 10 * HZ; delay = 10 * HZ;
} else { } else {
delay = 20 * HZ; delay = CEPH_MONC_PING_INTERVAL;
if (opt->monc_ping_timeout > 0)
delay = min(delay, opt->monc_ping_timeout / 3);
} }
dout("__schedule_delayed after %lu\n", delay); dout("__schedule_delayed after %lu\n", delay);
schedule_delayed_work(&monc->delayed_work, schedule_delayed_work(&monc->delayed_work,
...@@ -793,10 +790,9 @@ static void delayed_work(struct work_struct *work) ...@@ -793,10 +790,9 @@ static void delayed_work(struct work_struct *work)
__close_session(monc); __close_session(monc);
__open_session(monc); /* continue hunting */ __open_session(monc); /* continue hunting */
} else { } else {
struct ceph_options *opt = monc->client->options;
int is_auth = ceph_auth_is_authenticated(monc->auth); int is_auth = ceph_auth_is_authenticated(monc->auth);
if (ceph_con_keepalive_expired(&monc->con, if (ceph_con_keepalive_expired(&monc->con,
opt->monc_ping_timeout)) { CEPH_MONC_PING_TIMEOUT)) {
dout("monc keepalive timeout\n"); dout("monc keepalive timeout\n");
is_auth = 0; is_auth = 0;
__close_session(monc); __close_session(monc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment