Add a new entry in debugfs for MDT and OSD to display the uuid of clients
yet to be reconnected during a recovery.
For example:
$ lctl get_param obdfilter.lustre-OST0000.recovery_stale_clients
obdfilter.lustre-OST0000.stale_clients=
9a7ab21d-207c-4680-b9bf-
b5873fd05540
This will display, during the recovery, the UUIDs of clients
that are expected to be connected.
Signed-off-by: Courrier Guillaume <guillaume.courrier@cea.fr>
Change-Id: Ib8c0b500adc9098e3cfb1998df06757a7d31b7b9
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/44196
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Etienne AUJAMES <eaujames@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
/* lprocfs_status.c: recovery status */
int lprocfs_recovery_status_seq_show(struct seq_file *m, void *data);
+/* lprocfs: display the uuid of stale clients */
+int lprocfs_recovery_stale_clients_seq_show(struct seq_file *m, void *data);
+
/* lprocfs_status.c: hash statistics */
int lprocfs_hash_seq_show(struct seq_file *m, void *data);
{ NULL }
};
+LDEBUGFS_SEQ_FOPS_RO_TYPE(mdt, recovery_stale_clients);
+
+static struct ldebugfs_vars ldebugfs_mdt_obd_vars[] = {
+ { .name = "recovery_stale_clients",
+ .fops = &mdt_recovery_stale_clients_fops },
+ { NULL }
+};
+
static int
lprocfs_mdt_print_open_files(struct obd_export *exp, void *v)
{
mdt_obd_name(mdt), rc);
return rc;
}
+ ldebugfs_add_vars(obd->obd_debugfs_entry, ldebugfs_mdt_obd_vars, obd);
rc = tgt_tunables_init(&mdt->mdt_lut);
if (rc) {
}
EXPORT_SYMBOL(ldebugfs_add_symlink);
+int lprocfs_recovery_stale_clients_seq_show(struct seq_file *m, void *data)
+{
+ struct obd_device *obd = m->private;
+ struct obd_export *exp, *n;
+ int connected;
+
+ if (!obd->obd_recovering ||
+ atomic_read(&obd->obd_connected_clients) >=
+ atomic_read(&obd->obd_max_recoverable_clients))
+ /* not in recovery */
+ return 0;
+
+ spin_lock(&obd->obd_dev_lock);
+ list_for_each_entry_safe(exp, n, &obd->obd_exports, exp_obd_chain) {
+ /* don't count self-export as client */
+ if (obd_uuid_equals(&exp->exp_client_uuid,
+ &exp->exp_obd->obd_uuid))
+ continue;
+
+ /* don't count clients which have no slot in last_rcvd
+ * (e.g. lightweight connection)
+ */
+ if (exp->exp_target_data.ted_lr_idx == -1)
+ continue;
+
+ connected = !exp->exp_failed && (exp->exp_conn_cnt > 0);
+
+ if (!connected)
+ seq_printf(m, "%s\n", exp->exp_client_uuid.uuid);
+ }
+ spin_unlock(&obd->obd_dev_lock);
+
+ return 0;
+}
+EXPORT_SYMBOL(lprocfs_recovery_stale_clients_seq_show);
+
#ifdef CONFIG_PROC_FS
int lprocfs_evict_client_open(struct inode *inode, struct file *f)
{ NULL }
};
+LDEBUGFS_SEQ_FOPS_RO_TYPE(ofd, recovery_stale_clients);
+
+struct ldebugfs_vars ldebugfs_ofd_obd_vars[] = {
+ { .name = "recovery_stale_clients",
+ .fops = &ofd_recovery_stale_clients_fops},
+ { NULL }
+};
+
/**
* Initialize OFD statistics counters
*
obd->obd_name, rc);
RETURN(rc);
}
+ ldebugfs_add_vars(obd->obd_debugfs_entry, ldebugfs_ofd_obd_vars, obd);
rc = tgt_tunables_init(&ofd->ofd_lut);
if (rc) {