Whamcloud - gitweb
EX-8016 lipe: Identify lfs command issued by lamigo
authorAlexandre Ioffe <aioffe@ddn.com>
Tue, 1 Aug 2023 01:52:35 +0000 (18:52 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 1 Aug 2023 22:05:20 +0000 (22:05 +0000)
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 <aioffe@ddn.com>
Change-Id: I93ed62b030d9c1048c9c3fa7146077d54d2bde37
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51826
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lipe/src/lamigo.c

index 3beabfa..098512d 100644 (file)
@@ -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,