Whamcloud - gitweb
LU-17783 statahead: disable batch statahead for old server 17/55017/4
authorQian Yingjin <qian@ddn.com>
Mon, 6 May 2024 08:16:19 +0000 (04:16 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 29 May 2024 04:40:45 +0000 (04:40 +0000)
Disable the batch statahead for the old server that does not
support MDS_BATCH batch RPC.

Fixes: 4435d0121f ("LU-14139 statahead: batched statahead processing")
Test-Parameters: testlist=sanity serverjob=lustre-b_es6_0 serverbuildno=638 clientdistro=el9.3 serverdistro=el8.8 env=ONLY=123
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I79fba4204e0ed44e2bc9a4c4f2758d087f0e406b
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55017
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
lustre/include/lustre_export.h
lustre/llite/statahead.c

index 7216c47..8e11371 100644 (file)
@@ -525,6 +525,11 @@ static inline bool exp_connect_unaligned_dio(struct obd_export *exp)
        return (exp_connect_flags2(exp) & OBD_CONNECT2_UNALIGNED_DIO);
 }
 
+static inline bool exp_connect_batch_rpc(struct obd_export *exp)
+{
+       return (exp_connect_flags2(exp) & OBD_CONNECT2_BATCH_RPC);
+}
+
 enum {
        /* archive_ids in array format */
        KKUC_CT_DATA_ARRAY_MAGIC        = 0x092013cea,
index 77b2c02..1379b6c 100644 (file)
@@ -1533,7 +1533,11 @@ static int ll_statahead_thread(void *arg)
        CDEBUG(D_READA, "statahead thread starting: sai %p, parent %pd\n",
               sai, parent);
 
-       sai->sai_max_batch_count = sbi->ll_sa_batch_max;
+       if (exp_connect_batch_rpc(sbi->ll_md_exp))
+               sai->sai_max_batch_count = sbi->ll_sa_batch_max;
+       else
+               sai->sai_max_batch_count = 0;
+
        if (sai->sai_max_batch_count) {
                bh = md_batch_create(ll_i2mdexp(dir), BATCH_FL_RDONLY,
                                     sai->sai_max_batch_count);