imp_connect_tried:1,
/* connected but not FULL yet */
imp_connected:1;
- __u32 imp_connect_op;
- __u32 imp_idle_timeout;
- struct obd_connect_data imp_connect_data;
- __u64 imp_connect_flags_orig;
- __u64 imp_connect_flags2_orig;
- int imp_connect_error;
+ u32 imp_connect_op;
+ u32 imp_idle_timeout;
+ u32 imp_idle_debug;
+ struct obd_connect_data imp_connect_data;
+ __u64 imp_connect_flags_orig;
+ __u64 imp_connect_flags2_orig;
+ int imp_connect_error;
enum lustre_msg_magic imp_msg_magic;
/* adjusted based on server capability */
" current_connection: %s\n"
" connection_attempts: %u\n"
" generation: %u\n"
- " in-progress_invalidations: %u\n",
+ " in-progress_invalidations: %u\n"
+ " idle: %lld sec\n",
nidstr,
imp->imp_conn_cnt,
imp->imp_generation,
- atomic_read(&imp->imp_inval_count));
+ atomic_read(&imp->imp_inval_count),
+ ktime_get_real_seconds() - imp->imp_last_reply_time);
spin_unlock(&imp->imp_lock);
if (obd->obd_svc_stats == NULL)
obd_kset.kobj);
struct client_obd *cli = &dev->u.cli;
struct ptlrpc_request *req;
+ unsigned int idle_debug = 0;
unsigned int val;
int rc;
- rc = kstrtouint(buffer, 10, &val);
- if (rc)
- return rc;
+ if (strncmp(buffer, "debug", 5) == 0) {
+ idle_debug = D_CONSOLE;
+ } else if (strncmp(buffer, "nodebug", 6) == 0) {
+ idle_debug = D_HA;
+ } else {
+ rc = kstrtouint(buffer, 10, &val);
+ if (rc)
+ return rc;
- if (val > CONNECTION_SWITCH_MAX)
- return -ERANGE;
+ if (val > CONNECTION_SWITCH_MAX)
+ return -ERANGE;
+ }
LPROCFS_CLIMP_CHECK(dev);
- cli->cl_import->imp_idle_timeout = val;
-
- /* to initiate the connection if it's in IDLE state */
- if (!val) {
- req = ptlrpc_request_alloc(cli->cl_import, &RQF_OST_STATFS);
- if (req != NULL)
- ptlrpc_req_finished(req);
+ if (idle_debug) {
+ cli->cl_import->imp_idle_debug = idle_debug;
+ } else {
+ if (!val) {
+ /* initiate the connection if it's in IDLE state */
+ req = ptlrpc_request_alloc(cli->cl_import,
+ &RQF_OST_STATFS);
+ if (req != NULL)
+ ptlrpc_req_finished(req);
+ }
+ cli->cl_import->imp_idle_timeout = val;
}
LPROCFS_CLIMP_EXIT(dev);
list_add_tail(&cli->cl_shrink_list, &osc_shrink_list);
spin_unlock(&osc_shrink_lock);
cli->cl_import->imp_idle_timeout = osc_idle_timeout;
+ cli->cl_import->imp_idle_debug = D_HA;
RETURN(0);
}
if (unlikely(imp->imp_state == LUSTRE_IMP_IDLE)) {
int rc;
- CDEBUG(D_INFO, "%s: connect at new req\n",
- imp->imp_obd->obd_name);
+ CDEBUG_LIMIT(imp->imp_idle_debug,
+ "%s: reconnect after %llds idle\n",
+ imp->imp_obd->obd_name, ktime_get_real_seconds() -
+ imp->imp_last_reply_time);
spin_lock(&imp->imp_lock);
if (imp->imp_state == LUSTRE_IMP_IDLE) {
imp->imp_generation++;
if (IS_ERR(req))
RETURN(PTR_ERR(req));
- CDEBUG(D_INFO, "%s: disconnect\n", imp->imp_obd->obd_name);
+ CDEBUG_LIMIT(imp->imp_idle_debug, "%s: disconnect after %llus idle\n",
+ imp->imp_obd->obd_name,
+ ktime_get_real_seconds() - imp->imp_last_reply_time);
req->rq_interpret_reply = ptlrpc_disconnect_idle_interpret;
ptlrpcd_add_req(req);
if (!imp->imp_idle_timeout)
return false;
+
/* 4 comes from:
* - client_obd_setup() - hashed import
* - ptlrpcd_alloc_work()
*/
if (atomic_read(&imp->imp_refcount) > 4)
return false;
+
/* any lock increases ns_bref being a resource holder */
if (ns && atomic_read(&ns->ns_bref) > 0)
return false;
osc_ensure_active $SINGLEMDS $TIMEOUT
osc_ensure_active client $TIMEOUT
+ $LCTL set_param osc.*.idle_timeout=debug
if [ -n "$(lctl get_param -n mdc.*.connect_flags|grep jobstats)" ]; then
local current_jobid_var=$($LCTL get_param -n jobid_var)
if [ $JOBID_VAR = "existing" ]; then
echo "keeping jobstats as $current_jobid_var"
elif [ $current_jobid_var != $JOBID_VAR ]; then
- echo "seting jobstats to $JOBID_VAR"
+ echo "setting jobstats to $JOBID_VAR"
set_conf_param_and_check client \
"$LCTL get_param -n jobid_var" \