From 89cc7c4ce722c5347165a4ba72a03f37f660703c Mon Sep 17 00:00:00 2001 From: Alexandre Ioffe Date: Mon, 31 Jul 2023 18:52:35 -0700 Subject: [PATCH] EX-8016 lipe: Identify lfs command issued by lamigo Each shell command issued by lamigo on OSS is identied by attached comment. For example, "lfs mirror extend -N ... > /dev/null 2>&1 # lamigo testfs-MDT0000" This can help identify the source of the command and track down a reason why we have too many command running concurrently. Test-Parameters: trivial testlist=hot-pools Signed-off-by: Alexandre Ioffe Change-Id: I93ed62b030d9c1048c9c3fa7146077d54d2bde37 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51826 Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Tested-by: Andreas Dilger Tested-by: Maloo --- lipe/src/lamigo.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lipe/src/lamigo.c b/lipe/src/lamigo.c index 3beabfa..098512d 100644 --- a/lipe/src/lamigo.c +++ b/lipe/src/lamigo.c @@ -774,6 +774,7 @@ static int lamigo_exec_cmd(struct resync_agent *a, const char *cmd, int *pstatus { struct resync_ssh_session *rss; int rc; + char cmd1[PATH_MAX * 2]; pthread_mutex_lock(&a->rag_ssh_lock); /* @@ -788,9 +789,12 @@ static int lamigo_exec_cmd(struct resync_agent *a, const char *cmd, int *pstatus lipe_list_del(&rss->rss_list); pthread_mutex_unlock(&a->rag_ssh_lock); + /* Add lamigo identification */ + snprintf(cmd1, sizeof(cmd1), "%s # lamigo %s", cmd, opt.o_mdtname); + rc = a->rag_is_local ? - system(cmd) : - lipe_ssh_exec_timeout(&rss->rss_ctx, cmd, pstatus, + system(cmd1) : + lipe_ssh_exec_timeout(&rss->rss_ctx, cmd1, pstatus, opt.o_ssh_exec_to); if (rc) llapi_error(LLAPI_MSG_INFO, rc, -- 1.8.3.1