Skip to content

Commit

Permalink
LU-1095 debug: Report remaining recovery time consistently
Browse files Browse the repository at this point in the history
Consistency is good, always report the remaining recovery time
in the mm:ss format.  This patch get's the last 3 remaining
instances where it is simply reported as a total number of seconds.

Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Change-Id: If5599d8c24b1cd862ab89670553fcd24672cadbc
  • Loading branch information
behlendorf authored and morrone committed Feb 27, 2012
1 parent bfc91b3 commit 80f606c
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions lustre/ldlm/ldlm_lib.c
Expand Up @@ -610,22 +610,25 @@ static int target_handle_reconnect(struct lustre_handle *conn,

/* Might be a re-connect after a partition. */
if (!memcmp(&conn->cookie, &hdl->cookie, sizeof conn->cookie)) {
if (target->obd_recovering)
if (target->obd_recovering) {
int timeout = cfs_duration_sec(cfs_time_sub(
cfs_timer_deadline(
&target->obd_recovery_timer),
cfs_time_current()));

LCONSOLE_WARN("%s: Client %s (at %s) reconnect"
"ing, waiting for %d clients in "
"recovery for %lds\n", target->obd_name,
"ing, waiting for %d clients in recov"
"ery for %d:%.02d\n", target->obd_name,
obd_uuid2str(&exp->exp_client_uuid),
obd_export_nid2str(exp),
target->obd_max_recoverable_clients,
cfs_duration_sec(cfs_time_sub(
cfs_timer_deadline(
&target->obd_recovery_timer),
cfs_time_current())));
else
timeout / 60, timeout % 60);
} else {
LCONSOLE_WARN("%s: Client %s (at %s) "
"reconnecting\n", target->obd_name,
obd_uuid2str(&exp->exp_client_uuid),
obd_export_nid2str(exp));
}

conn->cookie = exp->exp_handle.h_cookie;
/* target_handle_connect() treats EALREADY and
Expand Down Expand Up @@ -934,15 +937,16 @@ int target_handle_connect(struct ptlrpc_request *req)

t = cfs_timer_deadline(&target->obd_recovery_timer);
t = cfs_time_sub(t, cfs_time_current());
t = cfs_duration_sec(t);
LCONSOLE_WARN("%s: Denying connection for new client "
"%s (at %s), waiting for %d clients in "
"recovery for "CFS_TIME_T"s\n",
"recovery for %d:%.02d\n",
target->obd_name,
libcfs_nid2str(req->rq_peer.nid),
cluuid.uuid,
cfs_atomic_read(&target-> \
obd_lock_replay_clients),
cfs_duration_sec(t));
(int)t / 60, (int)t % 60);
rc = -EBUSY;
} else {
dont_check_exports:
Expand Down Expand Up @@ -1404,8 +1408,9 @@ static void check_and_start_recovery_timer(struct obd_device *obd)
cfs_spin_unlock(&obd->obd_recovery_task_lock);
return;
}
LCONSOLE_INFO("%s: Starting recovery timer for %u seconds\n",
obd->obd_name, obd->obd_recovery_timeout);
LCONSOLE_INFO("%s: Starting recovery timer for %d:%.02d\n",
obd->obd_name, obd->obd_recovery_timeout / 60,
obd->obd_recovery_timeout % 60);
obd->obd_recovery_start = cfs_time_current_sec();
cfs_spin_unlock(&obd->obd_recovery_task_lock);

Expand Down

0 comments on commit 80f606c

Please sign in to comment.