Whamcloud - gitweb
LU-9620 tests: test race between pool_list and pool_remove 05/27505/4
authorJadhav Vikram <jadhav.vikram@seagate.com>
Thu, 8 Jun 2017 17:41:38 +0000 (23:11 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Jul 2017 03:31:08 +0000 (03:31 +0000)
Test ost-pools/test_27 added to test race between
pool_list and pool_remove.

Change-Id: I8497836dd6e8b2c20ade3626b7a1f84b98f3a94f
Seagate-bug-id: MRP-3629
Signed-off-by: Jadhav Vikram <jadhav.vikram@seagate.com>
Reviewed-by: Ashish Purkar <ashish.purkar@seagate.com>
Reviewed-by: Andriy Skulysh <andriy.skulysh@seagate.com>
Tested-by: Elena V. Gryaznova <elena.gryaznova@seagate.com>
Reviewed-on: https://review.whamcloud.com/27505
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/obd_support.h
lustre/lod/lod_pool.c
lustre/tests/ost-pools.sh

index 433c2f8..3d1dae7 100644 (file)
@@ -326,6 +326,7 @@ extern char obd_jobid_var[];
 #define OBD_FAIL_OST_PAUSE_PUNCH         0x236
 #define OBD_FAIL_OST_LADVISE_PAUSE      0x237
 #define OBD_FAIL_OST_FAKE_RW            0x238
 #define OBD_FAIL_OST_PAUSE_PUNCH         0x236
 #define OBD_FAIL_OST_LADVISE_PAUSE      0x237
 #define OBD_FAIL_OST_FAKE_RW            0x238
+#define OBD_FAIL_OST_LIST_ASSERT         0x239
 
 #define OBD_FAIL_LDLM                    0x300
 #define OBD_FAIL_LDLM_NAMESPACE_NEW      0x301
 
 #define OBD_FAIL_LDLM                    0x300
 #define OBD_FAIL_LDLM_NAMESPACE_NEW      0x301
index df66bb3..1b15f6c 100644 (file)
@@ -260,6 +260,8 @@ static void *pool_proc_next(struct seq_file *seq, void *v, loff_t *pos)
        if (*pos >= pool_tgt_count(iter->lpi_pool))
                return NULL;
 
        if (*pos >= pool_tgt_count(iter->lpi_pool))
                return NULL;
 
+       OBD_FAIL_TIMEOUT(OBD_FAIL_OST_LIST_ASSERT, cfs_fail_val);
+
        /* iterate to find a non empty entry */
        prev_idx = iter->lpi_idx;
        iter->lpi_idx++;
        /* iterate to find a non empty entry */
        prev_idx = iter->lpi_idx;
        iter->lpi_idx++;
index 5dd539a..4cfbe9f 100755 (executable)
@@ -1513,6 +1513,37 @@ test_26() {
 }
 run_test 26 "Choose other OSTs in the pool first in the creation remedy"
 
 }
 run_test 26 "Choose other OSTs in the pool first in the creation remedy"
 
+test_27() {
+       [[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return
+
+       local osts
+       local pid
+       local count=$OSTCOUNT
+
+       create_pool_nofail $POOL
+       do_facet mgs lctl pool_add $FSNAME.$POOL $TGT_ALL
+       osts=$(list_pool $FSNAME.$POOL)
+       for ost in ${osts}; do
+               ((count--))
+               if [[ $count -eq 0 ]]; then
+                       #define OBD_FAIL_OST_LIST_ASSERT    0x239
+                       do_facet $SINGLEMDS \
+                               $LCTL set_param fail_loc=0x239 fail_val=10
+                       list_pool $FSNAME.$POOL &
+                       pid=$!
+                       sleep 5
+                       do_facet $SINGLEMDS $LCTL set_param fail_loc=0
+                       do_facet mgs $LCTL pool_remove $FSNAME.$POOL $ost
+                       wait $pid
+                       do_facet $SINGLEMDS $LCTL set_param fail_val=0
+               else
+                       do_facet mgs $LCTL pool_remove $FSNAME.$POOL $ost
+               fi
+       done
+       destroy_pool $POOL
+}
+run_test 27 "Race pool_list and pool_remove"
+
 cd $ORIG_PWD
 
 complete $SECONDS
 cd $ORIG_PWD
 
 complete $SECONDS